ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to use a range name in a macro (https://www.excelbanter.com/excel-worksheet-functions/195851-how-use-range-name-macro.html)

CompetiveLat

How to use a range name in a macro
 
Hello and thanks,

I need to know how to use a named range in a macro!!! - Help.

(This in order to delete easily a range of cells)


Bob Phillips

How to use a range name in a macro
 
myVal = Range("myRange").Value

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"CompetiveLat" wrote in message
...
Hello and thanks,

I need to know how to use a named range in a macro!!! - Help.

(This in order to delete easily a range of cells)




StumpedAgain

How to use a range name in a macro
 
If you've already named the range you can simply use:

Range("myRange")

where myRange is your named range. If you want to assign a range to a name,
you can use:

Range("B1:C12").Name = "myRange"

Hope this helps!
--
-SA


"CompetiveLat" wrote:

Hello and thanks,

I need to know how to use a named range in a macro!!! - Help.

(This in order to delete easily a range of cells)



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

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