Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a range?
What is wrong with this code?
Dim MyArray As Variant Dim MyRange As Range Dim EndRow As Long Dim EndCol As Integer Debug.Print Sheets("Data").Range("A1") EndRow = Sheets("Data").Range("A1").End(xlDown).Row EndCol = Sheets("Data").Range("A1").End(xlToRight).Column Set MyRange = Worksheets("Data").Range(Cells(1, 1), Cells(EndRow, EndCol)) MyArray = MyRange The Set MyRange line errors out with an Runtime Error. EndRow and EndCol are valid locations, so it has to be how I use the cells in the range statement? Any help? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
setting range().hidden=True causes range error 1004 | Excel Programming | |||
Setting a range when value is given | Excel Programming | |||
Need help setting a range | Excel Programming | |||
Setting a Range | Excel Programming |