Refer to Named Ranges in Excel macro
Refer to Named Ranges in Excel
makes working in Microsoft Excel quite convenient and productive.
Ranges are easy to identify by name in Microsoft Excel. To name a
selected Excel range, click the name box at the left end of the formula
bar, type a name, and then press ENTER.
To select an Excel named range, use the GoTo method in
Microsoft Excel, which activates the Excel workbook and the spreadsheet
and then selects the range and finally clears or deletes the contents
of the range "MyRange".
The following example shows how the same procedure would
written for the active Excel workbook.
Macro actions cannot be undone.
Of course you can use a macro to define a named range and then access it to perform an action on it like clearing the contents as shown below:Sub NamedRange()
Dim Range1 As Range
Set Range1 = Sheets("Sheet1").Range("F4:F10")
ActiveWorkbook.Names.Add Name:="MyRange", RefersTo:=Range1
Watch the Excel Training video below to see the macro