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: 553
Default Extracting proper range address from multiple cell selections in V

Is there a way in VBA to ascertain if a range selection is contiguous. That
is, say I select C3 and D4 on the same page. The Address property for the
Selection does not automatically put the address into the form C3:D3 but
instead into the form $C$3,$D$3. Is there a way to do this in VBA or do I
have to write a function which tests the string for contiguous row or column
headers?

Sub Macro1()
Dim RngAddress As String
Range("C3,D3").Select
RngAddress = Selection.Address
Debug.Print RngAddress
End Sub

Immediate Window:
$C$3,$D$3

Thanks

EM
 
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
Multiple selections of rows & columns by clicking in one cell FSAnalyst Excel Worksheet Functions 0 November 25th 09 11:09 PM
Enabling multiple selections in same cell from dropdown menu Jimmy Excel Discussion (Misc queries) 0 January 2nd 08 05:55 PM
How do I select multiple selections using the range(cell(),Cell()) havocdragon Excel Programming 1 November 8th 06 05:02 PM
Apply formula to a range with multiple selections [email protected] Excel Programming 4 December 22nd 05 05:54 PM
Creating Multiple GIFs from Multiple Range selections -- I need a volunteer to test my code to see why it fails Father Guido[_5_] Excel Programming 0 November 19th 05 08:52 AM


All times are GMT +1. The time now is 10:29 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"