• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 67
  • Last Modified:

Use VBA to create a named range from a column of data, exclude blanks from the resulting name.

I want to create a named range by selecting only the cells in a column that contain data,
Data in the column can easily be sorted to move all the cells with  data to the top before defining the name .
0
AMixMaster
Asked:
AMixMaster
1 Solution
 
jkpieterseCommented:
(re)Sorting the data will wreck the range name, it will keep pointing to the same cells. The syntax for defining the name is:

intersect(activesheet.usedrange,Range("A:A")).SpecialCells(xlCellTypeVisible).Name = "TheName"
0
 
AMixMasterAuthor Commented:
works like a charm
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now