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
 
Thanks Alan, I was really trying to complicate things unnecessarily.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top