Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2015-02-11
2
Medium Priority
?
66 Views
Last Modified: 2016-02-10
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
Comment
Question by:AMixMaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
jkpieterse earned 2000 total points
ID: 40605015
(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
 

Author Closing Comment

by:AMixMaster
ID: 40605857
works like a charm
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question