Dynamic Range Naming for VBA

  • Thread starter Thread starter mrtoemoss
  • Start date Start date
M

mrtoemoss

I've searched through the many threads that deal with naming ranges but have
not
come a solution to my problem, thanks for your patience with another VBA
newbie.

In the code below, I correctly select the range which I would like to name
"MyRange"
What must I add to the code to name this selected range?

Worksheets("TempSheet").Range("A2:A" & Sheets.Count - 4).Select

Thanks for your help.
 
I've searched through the many threads that deal with naming ranges but have
not
come a solution to my problem, thanks for your patience with another VBA
newbie.

In the code below, I correctly select the range which I would like to name
"MyRange"
What must I add to the code to name this selected range?

Worksheets("TempSheet").Range("A2:A" & Sheets.Count - 4).Select

Thanks for your help.

Don't select it. Name it with

Worksheets("TempSheet").Range("A2:A" & Sheets.Count - 4).Name = "MyRange"

Watch for word wrap

Alan Beban
 
Back
Top