+ Reply to Thread
Results 1 to 4 of 4

Add column titles

  1. #1
    Registered User
    Join Date
    04-28-2006
    Posts
    14

    Add column titles

    Hey, I have a worksheet that contains a bunch of data, but I want to have a script that will move all of the data down one row and then insert column headings at the top say "example1", "example2", etc. Does anybody have any idea how to do this?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Bm4466,

    Here are 2 macros: Onr to insert the header row and one to insert the column header in the column you want. Add a Stabdard VBA Module to your Workbook and the copy and paste the code into it.

    Please Login or Register  to view this content.
    Example:
    Call AddHeaderRow first and then AddHeader as many times as needed...

    Call AddHeaderRow
    Call AddHeader "Example1", "A"
    Call AddHeader "Example2", "D"

    This adds the header "Example1" to column "A" and "Example2" to column "D".

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    04-28-2006
    Posts
    14
    Thanks, I appreciate it, will that add those strings to the first row and move the other rows down one?

  4. #4
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388
    Quote Originally Posted by bm4466
    Hey, I have a worksheet that contains a bunch of data, but I want to have a script that will move all of the data down one row and then insert column headings at the top say "example1", "example2", etc. Does anybody have any idea how to do this?
    This is the way I've done this in the past:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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