I
INTP56
Option Explicit
Public Sub DisconectedRange()
Dim vArray As Variant
Dim WSRange As Range
Dim L1 As Integer, U1 As Integer, L2 As Integer, U2 As Integer
With ThisWorkbook.Worksheets(1)
Set WSRange = Union(.Range(.Cells(2, 1), .Cells(4, 1)),
..Range(.Cells(2, 6), .Cells(4, 6)))
End With
vArray = WSRange.Value 'Only seems to capture WSRange.Areas(1)
L1 = LBound(vArray, 1)
U1 = UBound(vArray, 1)
L2 = LBound(vArray, 2)
U2 = UBound(vArray, 2)
MsgBox CStr(L1) + "," + CStr(U1) + vbCrLf + CStr(L2) + "," + CStr(U2)
'Is there a way to pull in a disconnected range into a Variant?
End Sub
Thanks, Bob
Public Sub DisconectedRange()
Dim vArray As Variant
Dim WSRange As Range
Dim L1 As Integer, U1 As Integer, L2 As Integer, U2 As Integer
With ThisWorkbook.Worksheets(1)
Set WSRange = Union(.Range(.Cells(2, 1), .Cells(4, 1)),
..Range(.Cells(2, 6), .Cells(4, 6)))
End With
vArray = WSRange.Value 'Only seems to capture WSRange.Areas(1)
L1 = LBound(vArray, 1)
U1 = UBound(vArray, 1)
L2 = LBound(vArray, 2)
U2 = UBound(vArray, 2)
MsgBox CStr(L1) + "," + CStr(U1) + vbCrLf + CStr(L2) + "," + CStr(U2)
'Is there a way to pull in a disconnected range into a Variant?
End Sub
Thanks, Bob