Saturday, October 3, 2015

How to create an array in VBA from an Excel range

If you have some data in Excel you want to retrieve in VBA under an Array, just use the "=" sign:

Sub create_array()
newarray = Sheets("Sheet1").Range("A1:B10").Value
MsgBox newarray(62)
End Sub



Created by DoMyExcel.com © | Excel & VBA Consulting | Customized Excel Solutions starting at 29 USD
Services provided to Individuals and Businesses | Free Quote: DoMyExcel@gmail.com

No comments:

Post a Comment