I’m a little stuck trying to store a value in a cell in another open workbook. I’m getting a subscript out of range error”, so clearly I’m not pointing to this cell correctly. Here is what I have:
Workbooks(wbSource).Activate
ActiveWorkbook.Sheet32.Range("currMth").Value = Me.cboCurrMth.Value
wbSource is a string that holds the name of the target workbook (“myfile.xls” for example). I’m confident that that is defined and set correctly.
I’ve tried lots of different ways to store this value, but nothing works. This is just one of my attempts. I’d prefer to not even activate this workbook if I can just populate it from the workbook where the code is written.
Can anybody see what I am doing wrong?
Thanks.
1.) What is Sheet32?
2.) I am not sure that you can index Ranges by name.
The following works: