+ Reply to Thread
Results 1 to 13 of 13

Automatically shifting cells

  1. #1
    Registered User
    Join Date
    10-23-2008
    Location
    toronto
    Posts
    19

    Automatically shifting cells

    Hello. first time posting on the forum. Seems to be great help over here so I decided to give it a shot.


    I'm looking to create a program that enables the macro to run with placing the desired cell blocks (A3:F12) from Sheet1 into Sheet2, and when i press the shortcut key again, it automatically places the cell blocks underneath the previous data that was pasted in the Sheet2. The goal of this is to keep a history of the data into the Sheet2.

    I'm new to this, especially with VBA but is there any possible way to create this type of macro program? Thank you in advance.
    Last edited by VBA Noob; 10-23-2008 at 05:21 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
    see if this gets you started

    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
    10-23-2008
    Location
    toronto
    Posts
    19
    Thanks for the help.


    I plugged in the code and what it does is after pasting the first set of data, the cells don't shift down, but rather erases the first row from the very top and continues to do so everytime i press the shortcut key until the all rows of the data are disappeared. I think you could be onto something though.

    Would you know what can be solved in this case?


    Edit: I just realized, it only deletes the rows when i stay in the Sheet2 window. If im in the Sheet1 window and press the shortcut key, data is only replaced in Sheet2, not added below.
    Last edited by w_lred; 10-23-2008 at 03:43 PM.

  4. #4
    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
    The code posts range A3:F12 in sheet 1 to the either the last cell in Col A in Sheet 2 or if it's blank then A2

    can you post a sample of what you're after if the above is wrong

    VBA Noob

  5. #5
    Registered User
    Join Date
    10-23-2008
    Location
    toronto
    Posts
    19
    Ok. I hope i can explain this clearly.

    I would like to move cells A3:F12 from Sheet1 to cell blocks A1:F10 in Sheet2.

    Now, when i want to change the data (from Sheet1) and press the shortcut key, it will transfer the new data below the first set of data (in Sheet2) to cells A13:F21 (since I would like to keep 2 rows of space).

    I would like to have it continue to place sets of datas below eachother infinitely (keeping 2 row spaces free between each set).

    Does this help a little?

    * I attached the file, the one i'm working on.
    Attached Files Attached Files
    Last edited by w_lred; 10-23-2008 at 04:03 PM.

  6. #6
    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
    Is this any better

    Please Login or Register  to view this content.
    VBA Noob

  7. #7
    Registered User
    Join Date
    10-23-2008
    Location
    toronto
    Posts
    19
    Nope... I attached the file for you. Sorry if it was too late for you to notice it before.

  8. #8
    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
    I tested on you're data. It put the first data to A1 to F10 then next data to A13 to F22 etc

    VBA Noob

  9. #9
    Registered User
    Join Date
    10-23-2008
    Location
    toronto
    Posts
    19
    no way! something must be wrong on my end then. its still only replacing the data. can u post your version of the file just to make sure?

  10. #10
    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
    As requested

    VBA Noob
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    10-23-2008
    Location
    toronto
    Posts
    19
    Seriously, Noob............. you're awesome!! It worked! I love the button too. how did you create the button?

    Very much appreciated!

  12. #12
    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
    Button from the control toolbar

    http://www.bettersolutions.com/excel...B126512321.htm

    you can also use the button from the forms toolbar or even a sheet
    http://www.bettersolutions.com/excel...B215612321.htm

    To use a shape right click and assign macro or make a custom menu
    http://www.ozgrid.com/VBA/custom-menus.htm



    VBA Noob

  13. #13
    Registered User
    Join Date
    10-23-2008
    Location
    toronto
    Posts
    19
    Once again, thank you!

+ 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