ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   turning selection into a range (https://www.excelbanter.com/excel-programming/338786-turning-selection-into-range.html)

schoujar[_5_]

turning selection into a range
 

A few cells are selected and my macro is run, how do i define a range
out of the selection. in other words the range should be the cells that
are selected. how?

Thanx


--
schoujar
------------------------------------------------------------------------
schoujar's Profile: http://www.excelforum.com/member.php...o&userid=26574
View this thread: http://www.excelforum.com/showthread...hreadid=400681


T-Žex[_46_]

turning selection into a range
 

The 'Selection' property already returns a Range of selected cells...
If you want to assign the selected cells to a Range variable, you can
do this:

Dim YourRange As Range
Set YourRange = Selection


schoujar Wrote:
A few cells are selected and my macro is run, how do i define a range
out of the selection. in other words the range should be the cells that
are selected. how?

Thanx



--
T-Žex
------------------------------------------------------------------------
T-Žex's Profile: http://www.excelforum.com/member.php...o&userid=26572
View this thread: http://www.excelforum.com/showthread...hreadid=400681



All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com