Referencing a Name from within VBA

cmazur71

New Member
Joined
Aug 7, 2003
Messages
47
I have a Name (DISCOUNT) defined in my workbook. (DISCOUNT refers to cell A20)

How can I reference that Name from within VBA?

This code works, but DISCOUNT may not always reference A2. I may insert additional rows.
Set AMOUNT = Worksheets("Quote").range("A20")
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196
cmazur71 said:
I have a Name (DISCOUNT) defined in my workbook. (DISCOUNT refers to cell A20)

How can I reference that Name from within VBA?

This code works, but DISCOUNT may not always reference A2. I may insert additional rows.
Set AMOUNT = Worksheets("Quote").range("A20")

This should do it.
Set AMOUNT = Worksheets("Quote").range("DISCOUNT")
 

Watch MrExcel Video

Forum statistics

Threads
1,114,093
Messages
5,545,917
Members
410,711
Latest member
Josh324
Top