Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Referring to a user-selected range

Can anyone advise how I can refer to a range in a spreadsheet that has
been selected by the user? Late in the macro, I need to loop through
all the cells in a range that the user selected earlier, and perform
an operation on each of them that depends on its location within the
range, but I can't figure out how to identify the range.

Thanks

James McIntosh
Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Referring to a user-selected range

James,

Sub testit()
Dim rng As Range

If TypeOf Selection Is Range Then
For Each rng In Selection
Debug.Print rng.Address
Next
End If
End Sub


Rob

"James Mc" wrote in message
om...
Can anyone advise how I can refer to a range in a spreadsheet that has
been selected by the user? Late in the macro, I need to loop through
all the cells in a range that the user selected earlier, and perform
an operation on each of them that depends on its location within the
range, but I can't figure out how to identify the range.

Thanks

James McIntosh
Australia



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Referring to a user-selected range


Rob,
Thanks for the code, I'll try it

James



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
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
dynamic chart on user selected data range in Excel 2007 turen Charts and Charting in Excel 5 September 1st 07 02:03 AM
Referring to the previous selected sheet in a macro michaelberrier Excel Discussion (Misc queries) 2 June 12th 06 01:35 PM
Identify User Selected Range RonF Excel Programming 3 January 12th 04 04:36 PM
Identify Range Selected By User RonF Excel Programming 1 January 9th 04 05:29 PM
Determining end of user-selected range Syed Faisal Excel Programming 2 October 23rd 03 05:22 PM


All times are GMT +1. The time now is 09:02 AM.

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

About Us

"It's about Microsoft Excel"