LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Disconnected Range to Variant

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I assign range to variant and use Mike H[_2_] Excel Discussion (Misc queries) 7 June 7th 07 01:40 AM
Assigning range to variant vezerid Excel Programming 2 March 12th 07 04:46 PM
Assigning range to variant vezerid Excel Programming 2 March 12th 07 04:45 PM
How to define a Range with variant? Yiu Choi Fan Excel Programming 6 July 12th 04 04:41 PM
Best way to paste a variant array into a range? AnneB Excel Programming 2 April 28th 04 09:57 PM


All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"