Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

EXCEL Range and Label Names

  Asked By: Leon    Date: Nov 13    Category: MS Office    Views: 789
  

I have defined many Range names and label names
in one worksheet. Is there a way for me to `copy' the label and range
names from this worksheet to the others within the same EXCEL
spreadsheet?

If I can automate that task with VB it will save a great amount
of time and manual effort.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Nathan Evans     Answered On: Nov 13

Do this.

sub CopyToWorksheets()
i = 1 'starting row of cell containing data

sheets(1).select
with activesheet
do while .cells(i, 1) <> "" 'checks for end of data
i = i + 1
loop
range("A" & 1 "X:" & i).copy 'copy range  of data starting with cells
A1 to last row of column X
for n = 2 to sheets.count 'start with copying data to sheet 2, sheet
3, etc...
sheets(n).select 'select sheet to copy data into
range("A1").select
activesheet.paste
next n
sheets(1).select
range("A2").select
end with
end sub

 
Didn't find what you were looking for? Find more on EXCEL Range and Label Names Or get search suggestion and latest updates.




Tagged: