LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Report Post  
Posted to microsoft.public.excel.misc
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh an Access Query using VBA code in Excel Peter G[_2_] Excel Programming 6 October 28th 09 03:18 PM
VB Code or Excel macro to run Query/Import on Access file Harry[_8_] Excel Programming 13 February 22nd 05 07:27 PM
VB macro code for SQL Query Dan[_39_] Excel Programming 5 July 19th 04 02:56 PM
Excel Query - Code problem Reney Langlois Excel Programming 3 June 15th 04 01:03 PM
Code to run an Access query from Excel Kelly[_7_] Excel Programming 3 January 17th 04 04:12 PM


All times are GMT +1. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"