+ Reply to Thread
Results 1 to 5 of 5

auto insert column when sheet is opened

  1. #1
    Registered User
    Join Date
    03-10-2008
    Posts
    10

    auto insert column when sheet is opened

    I have an outside program that feeds measurement results into Excel. The programming of this outside software only allows the insertion of data into one column of a worksheet, Column C. Currently, we need to manually open the excel sheet, insert a new column, and close the worksheet between measurment runs. My question is whether there is a way to program excel to automatically insert a column when this outside program opens or closes the worksheet? Any insight on this subject would be very much appreciated.

    Mike

  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 Mike,

    Welcome to the Forum!

    If I understand your post, the data is always posted into column "C", correct? One other question. What version of Excel are you using?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-10-2008
    Posts
    10
    Yes, the data is always put in column C. We are currently using excel 2003. Thank you for trying to help,pulling our hair out here

  4. #4
    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 SMUGGLINGSTONES,

    Once installed, this macro will insert a new column in column "C" and shift the old column "C" to the right whenever the workbook is opened. Change the sheet name in the code to match yours.
    Please Login or Register  to view this content.
    How to Save a Workbook Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open your Workbook and Right Click on any Worksheet's Name Tab
    3. Left Click on View Code in the pop up menu.
    4. Press ALT+F11 keys to open the Visual Basic Editor.
    5. Press CTRL+R keys to shift the focus to the Project Explorer Window
    6. Press the Down Arrow Key until ThisWorkbook is highlighted in blue.
    7. Press the Enter key to move the cursor to the Code Window
    8. Paste the macro code using CTRL+V
    9. Save the macro in your Workbook using CTRL+S

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    03-10-2008
    Posts
    10

    Thank you Thank you

    Works Great! Thanks a Bunch! I owe you one!

    Mike

+ 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