Hi, I have some code I am looking at, and it currently assigns values to a VBA array as a block from a range in the spreadsheet by doing:
I want to do this same thing without selecting. I triedCode:Dim DataArray As Variant Workbooks("whatever.xlsm").Activate Sheets("Sheet1").Select DataArray = Range("A2:EV1000").Value
but that gave an error. What should I do? Thanks for any help!Code:DataArray = Workbooks("whatever.xlsm").Sheets("Sheet1").Range("A2:EV1000").Value
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
UPDATE: Apparently, the code above does work. But, the code I actually used was Windows("whatever.xlsm")... I had never seen Windows used before but it was in code I was updating a bit. So, my new question is:
What's the different between Windows and Workbooks? Are they mostly the same? Why does Windows not work above, but Workbooks does?
Thanks




Reply With Quote
