Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scatter Brain!

Status
Not open for further replies.

ncook12

Technical User
Jul 17, 2003
8
GB
I have had problems with a particular spreadsheet i have been developing using VBA. I have had lots of help.
I was advised to go to Insert>Name>Define to name the title of the column. Then in 'refer to' i was given a line of code to enter - but i can't find it anywhere. It was because the range is to refer to a dynamic data range.Can anyone help? Please!
 
ncook,

Need to know what you intend to define with the name.

You can use the OFFSET function.

To name the range UNDER the heading...
Code:
=offset(
then click the cell under the heading...
Code:
=offset(Sheet1!$A$2
I clicked on A2. then continue with the COUNTA function...
Code:
=offset(Sheet1!$A$2,0,0,counta(
then click on the COLUMN...
Code:
=offset(Sheet1!$A$2,0,0,counta(Sheet1!$A:$A
and then finish...
Code:
=offset(Sheet1!$A$2,0,0,counta(Sheet1!$A:$A)-1,1)
What this does is takes the A2 reference and creates a range, as long as COUNTA and 1 column wide.

Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top