+ Reply to Thread
Results 1 to 5 of 5

Button insert row function

Hybrid View

  1. #1
    Registered User
    Join Date
    01-14-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Talking Button insert row function

    Hi all, noob here

    What I want to do is create a button that I can place into a cell that will insert a row above the button without messing up the left hand merged cells.
    so if I was to place the button into cell I3 and I the function of this button is to insert a row above, but the catch is that columns A-H have got rows 2 and 3 merged.

    This is what I have below

    ..A..B..C..D..E..F..G..H.......I
    1
    ----------------------|------|--------
    2..............................|------|--------
    3..............................|Button|--------
    ----------------------|-------|-------

    I want
    ..A..B..C..D..E..F..G..H.......I
    1
    ----------------------|------|--------
    2..............................|------|--------
    3..............................|------|--------
    4..............................|Button|--------
    ----------------------|-------|-------


    I have this setup multiple times down the page so I will want multiple buttons, I dont want the user to have to select the cell to insert the row above into if thats possible.so insert the row about the location of the button.

    So if I want to add in another key date for a project I can click this button to insert another row where I can fill out the fields to the right.

    I have tried a number of ways, using offsets but I am fairly new to VBA and macro creation. I found that when you added rows say for the first button located on the sheet that initially would be at I3 the references for the other buttons usually went out, I have tried to use a variable that is changed each button press to keep the stuff in order but I dont think i did it right.

    Any help would be greatly appreciated.

    Thanks

    picture below

    button.JPG
    Last edited by Valdima; 01-14-2012 at 09:15 PM. Reason: adding picture

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Button insert row function

    Post a dummy workbook if you can?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    01-14-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Button insert row function

    here you go buddy

    dummyworkbook.xls

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Button insert row function

    Can you clarify, do you want one r two rows inserted? Do you want the rows to have the same formatting as what you have now?

  5. #5
    Registered User
    Join Date
    01-14-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Button insert row function

    yeah

    I want a button in cell i3 initially that will when pushed insert one row above and thus shift the button down to i4 and this will not mess up the merged cells on the left,

    the aim is; if a project needs another key date it is possible to add more, therefore I will need multiple buttons for each project.

    does that help?

+ 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