Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Range from highlighted area

I want to work with a range; the location, size etc., is defined by the
user highlighting an area on the worksheet then starting up a macro. How
do I use the currently highlighted area as a range?
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Range from highlighted area

Use the Selection object. E.g.:

Selection.Interior.ColorIndex = 6

In article , noyb
wrote:

I want to work with a range; the location, size etc., is defined by the
user highlighting an area on the worksheet then starting up a macro. How
do I use the currently highlighted area as a range?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Range from highlighted area

This highlighted area is called the selected range, and can be accessed in
VBA with the Selection object.

Selection.Address

returns the address of that selection,

etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"noyb" wrote in message
...
I want to work with a range; the location, size etc., is defined by the
user highlighting an area on the worksheet then starting up a macro. How
do I use the currently highlighted area as a range?
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Range from highlighted area

Selection

as in

msgbox Selection.Address

--
Regards,
Tom Ogilvy

"noyb" wrote in message
...
I want to work with a range; the location, size etc., is defined by the
user highlighting an area on the worksheet then starting up a macro. How
do I use the currently highlighted area as a range?
Thanks



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
deselecting a highlighted range after a VBA copy procedure Paul James[_3_] Excel Programming 6 April 25th 23 03:47 AM
Shading on highlighted range of cells TippieToe Excel Discussion (Misc queries) 0 April 20th 10 11:54 PM
Need undo a highlighted spreadsheet where there's no white area. marySko New Users to Excel 1 April 7th 10 11:16 PM
Count Highlighted numbers in an area basic Excel Discussion (Misc queries) 2 November 18th 08 02:18 PM
autosum refusal to sum highlighted range lawrence Excel Worksheet Functions 4 April 30th 08 10:08 PM


All times are GMT +1. The time now is 05:37 AM.

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"