View Single Post
  #23   Report Post  
Posted to microsoft.public.excel.misc
Victor Delta[_2_] Victor Delta[_2_] is offline
external usenet poster
 
Posts: 199
Default Excel macro - VBA code query

In article , lid says...

Garry

Thank you so much for all your hard work. This looks great. However,
when I run the new CopyTitle macro, it only operates on the cell
where
the cursor is - when it's G3, the correct title is inserted for the
top
group of data - but it doesn't do anything on the rest of the
sheet...?

The new macro does all sections on my test sheet, so I suspect you did
not do the defined names correctly.

Should I have mentioned that I'm using Excel 2003 in case that is
relevant?


Here's how to do the defined names for each sheet in xl2003...

Delete all existing names;

Select G3;

Open the Define Names dialog;

Type in the NameBox like this...

'sheet1'!TitleName

..where you need to replace "sheet1" with the actual sheetname;
*Note:* this accounts for the space in the sheetname. I don't use
spaces so I never need to include the apostrophes. Sometimes I'll
use an underscore...
"2016" or "2016_Jan"
"ByDay" or "By_Day"
..for example, so I just have to type "2016!DefinedName"

Tab into the RefersTo field and select the appropriate cell in row4
that contains the title name on that sheet;

Press F2 and use the left arrow key to position to remove the $
symbols so the RefersTo is fully relative;

Click Add and close the dialog.

Repeat for each sheet.

Finally, the merge line is just to improve the overall appearance of
the
data titles.



Many thanks. I'll see if I can get it working tomorrow.

V