J
JerryH
I am creating an array from a selection on a sheet. My test lines show the
array has the correct rows and columns by looking at X and Y. I put a
breakpoint in the for/next loop to look at each data value but they always
show empty.
Here is the code I'm using:
'Make this workbook active
ThisWorkbook.Activate
ActiveWorkbook.Sheets(2).Activate
'Make cell A1 active
Worksheets(2).Range("A1").Activate
'Select all active cells on sheet
ActiveCell.CurrentRegion.Select
'Send all active cells to vaData array
vaData = Range(ActiveWindow.RangeSelection.Address).Value
'Test lines
Dim x As Long
Dim y As Long
x = UBound(vaData, 1)
y = UBound(vaData, 2)
For rwData = LBound(vaData, 1) To UBound(vaData, 1)
Data = vaData(rwData, 1)
Next
thanks,
Jerry
array has the correct rows and columns by looking at X and Y. I put a
breakpoint in the for/next loop to look at each data value but they always
show empty.
Here is the code I'm using:
'Make this workbook active
ThisWorkbook.Activate
ActiveWorkbook.Sheets(2).Activate
'Make cell A1 active
Worksheets(2).Range("A1").Activate
'Select all active cells on sheet
ActiveCell.CurrentRegion.Select
'Send all active cells to vaData array
vaData = Range(ActiveWindow.RangeSelection.Address).Value
'Test lines
Dim x As Long
Dim y As Long
x = UBound(vaData, 1)
y = UBound(vaData, 2)
For rwData = LBound(vaData, 1) To UBound(vaData, 1)
Data = vaData(rwData, 1)
Next
thanks,
Jerry