+ Reply to Thread
Results 1 to 11 of 11

Pushing data across column when new data it entered.

  1. #1
    Registered User
    Join Date
    11-12-2008
    Location
    New Zealand
    Posts
    3

    Pushing data across column when new data it entered.

    Hi all
    Have attached a small 2007 excel spreadsheet to help explain my needs.
    I would like to know if there is a function that when data is entered into column A it is then transfered to column B, B data transfers to C, C to D, D to E etc. with the K data falling off (10 Columns). I need this process to happen even when the new A input data is of the same value as the last A input data.
    Thanks
    Attached Files Attached Files
    Last edited by VBA Noob; 11-13-2008 at 05:17 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Right-click on the sheetname tab and select View Code. Paste this code into the window that pops up:
    Please Login or Register  to view this content.
    It should exactly like that. Press Alt-Q to close the VB editor. Now type something in cell B7.
    Last edited by JBeaucaire; 11-13-2008 at 12:39 AM. Reason: Added 3rd line of code to reset cursor back to cell B7
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-12-2008
    Location
    New Zealand
    Posts
    3

    Pushing Data

    Hi
    Thanks for your response.
    Did as your suggestion, with no luck. I might not be following your instructions correctly, will try again when I have time Tomorrow.

    Thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    It might be as simple as pressing the Design Mode icon a couple of times. Turning ON Design Mode allows you to make changes to pages with code running without the code firing off while you're editing it, thus technically suspends it. Turn Design Mode OFF again to re-enable the background macros.

    Since this macro I've given is a WorkBook_Change macro, it runs all the time, and fires every time you type something new in B7. I've seen times where when the code is first entered, it doesn't work again until you toggle Design Mode On/Off again. Or just enter the code, save the workbook, close it, reopen it and the code is firing away.

    Make sure when you're done pasting in the code it looks EXACTLY as shown above, no extra Sub or End Sub lines.

    Here's a copy of your sheet firing away.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-12-2008
    Location
    New Zealand
    Posts
    3

    Smile (Solved) Pushing Data

    Hi
    Thanks Rocketman, I need to do more training in xcel, still in the dark Dos days.
    Thanks again.

  6. #6
    Registered User
    Join Date
    02-14-2011
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Pushing data across column when new data it entered.

    Hi JBeaucaire or any other excel wizard, could you show me how to apply this code to more than 1 cell i.e (B7) .. in other words how can I continue this VB formula say from B7 to B55. thanks

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Pushing data across column when new data it entered.

    Looking at the code you should spot the RANGE reference. In it I have referenced a single cell as the range. You can change that to be the range you want.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-14-2011
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Pushing data across column when new data it entered.

    Hi, thanks for getting back so fast, what i'm actually trying to do is work the code over 2 rows, for example I have data in A1,B1,A2 and B2 in that order as A1 is my most recent info and B2 the oldest I wish to delete B2 and have A1 move into B1, B1 into A2 and A2 into B2 if that makes sense, i've had a crack at it with the code you provided but unfortunately as i'm just starting out I need some help, thanks again.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Pushing data across column when new data it entered.

    1) you only enter values in A1
    2) when you type a value into A1, you want the old values to move like so:

    A1 >> B1
    B1 >> A2
    A2 >> B2
    B2 value drops away

    Correct?

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Pushing data across column when new data it entered.

    If the above is correct, then put this macro into the SHEET MODULE where you want this action occurring. It will work in realtime. Just change the value of A1 and the values will rotate.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    02-14-2011
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Pushing data across column when new data it entered.

    Absolutely perfect, thanks so much, hope to be where you are one day in the vb knowledge department

+ 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