+ Reply to Thread
Results 1 to 5 of 5

Inserting a new column in another sheet

  1. #1
    Registered User
    Join Date
    12-07-2006
    Posts
    36

    Inserting a new column in another sheet

    Hi.
    I have some code which runs by clicking a button in Sheet1.
    I want the code to insert a new column in Sheet2 (using a variable 'colNo', which holds the column insert location as a number.)

    I thought the following piece of code would do this okay:

    Please Login or Register  to view this content.
    . . . but it doesn't work.
    I keep getting a '1004' error(?)

    Does anyone know how to do this correctly?

    Thanks in advance for your help.
    Last edited by VBA Noob; 01-14-2009 at 01:39 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No need to select.

    Try

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-13-2009
    Location
    Niterói, Brasil
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    6
    Hi iterature,

    I copy/pasted your original code and it worked here.

    You might be having problems in another part of your code.

    Eric.

  4. #4
    Registered User
    Join Date
    12-07-2006
    Posts
    36

    Solved

    'VBA Noob' - that seems to work fine. Many thanks.

    echiesse - the original code doesn't even work on my system when it's the only code in the button.


    Thanks for your help, guys.


  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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