+ Reply to Thread
Results 1 to 2 of 2

Macro for Add Column Header to All Worksheets

Hybrid View

  1. #1
    Registered User
    Join Date
    11-27-2008
    Location
    Manila, Philippines
    Posts
    20

    Macro for Add Column Header to All Worksheets

    Given:
    sheet1. NAme = "Header" (where my column header is located)
    Sheet2 to Sheet N = where the daily extracted data are located. Each wrksheet has equal number of columns but it has no header.

    Problem: A macro that Insert the column header (Row 1) to all the worksheets in the workbook upon clicking a button.

    Im newbie in macros programming. You're help will be highly appreciated.

    Thanks in advance and have a great day.
    Last edited by VBA Noob; 11-27-2008 at 09:17 AM.

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi,

    In many cases, the best way to learn how to code to automate repetitive actions is to "record a macro" & then review/use the resulting code as a base - this is one of those times...

    To record a macro go to Tools-Macros-Record new macro ie [alt + t + m + r], go through the steps, press Stop on the small popup toolbar (appears for me in Excel 2003). Press [alt + F11] to bring up the VBE, [ctrl + r] to show the "projects" you have open & find the file that contains the new macro. Review the code, test for flexibility & then post back if you have specific questions.

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1