Automatically insert column headings into Excel worksheet

ilfan83

New Member
Joined
Jan 25, 2005
Messages
5
I am fairly new to Excel programming. Is there a way to insert a set number of column headings, in an Excel worksheet, at the standard page breaks?? This would be for a document that will be used as a template and the same headings would be used for different projects. What I envision is the user would indicate the number of column headings desired in a window that would be displayed when the document is opened.

Is this all possible???

Any assistance would be greatly appreciated.

Thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

tmischler

Well-known Member
Joined
Jun 17, 2004
Messages
669
Either set up the sheet as you would like and at the same time record what you are doing by the "record macro" button or just set up the sheet the way you want and get people to use it as a template.
 

ilfan83

New Member
Joined
Jan 25, 2005
Messages
5
Re: Automatically insert column headings into Excel workshee

Hi tmischler,

I tried recording a macro, but when I used the macro to insert the column headings, the headings were always inserted into the same row (the row where I pasted the headings). Is there a way to manipulate the macro code to have the headings insert into the row where the cursor is on the worksheet??

By the way, I am trying to assist another employee in designing the document. I am fluent in Access, but not Excel.
 

tmischler

Well-known Member
Joined
Jun 17, 2004
Messages
669
Are all the other headings going to be in the same position relative to the first?

If so, record the macro again but this time set the recorder to relative reference.
 

ilfan83

New Member
Joined
Jan 25, 2005
Messages
5

ADVERTISEMENT

Re: Automatically insert column headings into Excel workshee

The answer to your question is Yes.

How do I use relative reference??

Thanks
 

tmischler

Well-known Member
Joined
Jun 17, 2004
Messages
669
when you click on record macro, there is a button next to the blue circle. That is the relative reference button. Click that on / off depending on your needs.
 

ilfan83

New Member
Joined
Jan 25, 2005
Messages
5

ADVERTISEMENT

Re: Automatically insert column headings into Excel workshee

Thanks for your help!
 

ilfan83

New Member
Joined
Jan 25, 2005
Messages
5
Re: Automatically insert column headings into Excel workshee

Yes. Thanks
 

Forum statistics

Threads
1,147,845
Messages
5,743,513
Members
423,801
Latest member
paulj4177

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top