First, I want to thank all the awesome people who have helped me so far. I've managed to streamline my tasks significantly with the VBA help that the people on this forum have provided. Thank you so much!
Now, my current bit of tinkering. I use a single file that has my macros programmed into it ("Macro storage file"). I open it, then I open a separate workbook that I run the macros in and update my data (we'll call it "520 Data"). I'd like to use a cell in Macro Storage File (B4) to generate a value in a 520 Data Worksheet (Test).
So far, this is what I cobbled together:
However, attempting to run this generates a "Subscript out of range" error for the Set wkb line. I'm not certain if I'm going about this the wrong way or not, so any feedback would be appreciated.
Now, my current bit of tinkering. I use a single file that has my macros programmed into it ("Macro storage file"). I open it, then I open a separate workbook that I run the macros in and update my data (we'll call it "520 Data"). I'd like to use a cell in Macro Storage File (B4) to generate a value in a 520 Data Worksheet (Test).
So far, this is what I cobbled together:
Code:
Sub Variable()
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Set wkb = Excel.Workbooks("Macro storage file.xlsx")
Set wks = wkb.Worksheets("MAIN")
CM = wks.Range("B4")
Worksheets("Test").Range("B3").Value = CM
End Sub
However, attempting to run this generates a "Subscript out of range" error for the Set wkb line. I'm not certain if I'm going about this the wrong way or not, so any feedback would be appreciated.
Last edited: