+ Reply to Thread
Results 1 to 16 of 16

Add Column & sheet with Button

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Add Column & sheet with Button

    Hello,
    Can someone point me in the right direction?

    Im looking to have a button that will do a few things.
    -insert a new column (with the same formula as adjacent ones)
    -fill in the value of cell on row 5 with the initials in cell "C20"

    -create a new sheet (COPY OF EXISTING USER SHEET or a blank template from user sheet)
    -rename the sheet with the initials in cell "C20"
    -copy value of C21 into new sheet cell B1

    - clear contents of MASTER cell C20 and C21


    is all that even possible?
    TIA.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Add Column & sheet with Button

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    ohhh thanks John, very very close.

    it seems the new column add does not go on and on. it just seems to cycle adding one then another then copies over the first.

    That code copies the current sheet, (I need it to copy one of the other sheets(maybe I could name the sheet to be copied as "USER"))
    what line would I edit to choose a different sheet to copy?

    any way to make the new sheet add at the end of the tabs?

    thanks very much for your very clever assistance.

  4. #4
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    is it easier to always add a new column after column "I" copying the formula from column "I" as id does it? ?

    once again I appreciate your help.

  5. #5
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    Please Login or Register  to view this content.
    ive made some changes that seem to sort the copy sheet issues, BUT im still having problems with the copy/new column. it overwrites existing ones.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Add Column & sheet with Button

    Hi no1_fred

    Try this Code in the attached.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  7. #7
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    WOW.

    That is nearly perfect.
    unfortunately it is too complex for me to immediately understand how to make a very tiny tweak.
    Can I have the users full name populated into the new sheets cell B2? (instead of just the initials?
    Point me to what line would do that?
    Would I need to add another variable like "d" and "find" the "name"??

    Thank you so very much.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Add Column & sheet with Button

    Hi no1_fred

    Try these mods...
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    well that did it!

    now to go try understand what all of your code does.
    thank you again!!!

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Add Column & sheet with Button

    I'll comment the Code and repost...it's really quite simple.

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Add Column & sheet with Button

    Here's the Commented Code...any questions, please ask...
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    that will go A VERY LONG WAY to help my understanding. thanks again!!

  13. #13
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    John, could you help me a little further.

    Ive updated the sheet quite a bit with more functionality (with lots of help)
    see attached.

    It all works as I want in the attached condition. BUT I want to now hide the "projects" and "template" sheets.
    when I do that and try to add a new user it just overwrites the last tab instead of making a new one.

    any ideas?

    thanks
    Attached Files Attached Files

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Add Column & sheet with Button

    Add the 4 indicated lines of Code...
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    04-24-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Add Column & sheet with Button

    John,

    My poor understanding ( I think maybe on the merge and un merge ) means ive messed something up.
    I added a new Column A and Row 1 just to provide some white space.
    But now new column add button does not add it at the end.

    I tweaked the code but I think its the merged cells are stuffing it up.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Add Column & sheet with Button

    Hi Fred

    Just a few minor changes...
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] advice activex button vs form button on protected sheet
    By Alina Loredana in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2015, 04:38 AM
  2. Replies: 0
    Last Post: 03-11-2015, 07:01 PM
  3. Button to copy specific cells to another sheet, lock button if cell has text
    By elmerg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 02:10 AM
  4. Macro button to copy data from one sheet to another sheet's next available column
    By Alice21 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-23-2013, 08:02 AM
  5. Replies: 0
    Last Post: 03-13-2013, 03:14 PM
  6. Replies: 0
    Last Post: 09-17-2012, 02:07 AM
  7. Replies: 2
    Last Post: 09-10-2012, 03:02 AM

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