+ Reply to Thread
Results 1 to 7 of 7

Move Data One Cell to the Right after Data Entry

  1. #1
    Registered User
    Join Date
    07-05-2010
    Location
    Tel Aviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    3

    Move Data One Cell to the Right after Data Entry

    I've seen a few responses on the board on how to solve this but they all seem far too complicated for the actions I need to do.

    I want to create a simple history of dates... in column F the user fills in the current date, and all I want is for this date to jump to column G leaving F blank, and then the same thing to occur when we want to enter another date, so that the second date will be entered into F, go to G, and then the first date to go from G to H, and so on. So basically a +1 rule in the column.

    I understand that I need to use a macro and for some reason all the ones I've come across that seem relatively simple have no effect on my enteries.

    PLEASE HELP I'm a excel newbie!

  2. #2
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Move Data One Cell to the Right after Data Entry

    Please see attached workbook. It uses a worksheet change event:

    Please Login or Register  to view this content.

    Right click on the sheet tab where you will be entering the data, select View Code and copy and paste the code above into the worksheet module.

    EDIT:

    The history is represented as a string of dates in column G separated by a comma. I hope this is ok for you.
    Attached Files Attached Files
    Last edited by pb71; 07-05-2010 at 11:44 AM.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Move Data One Cell to the Right after Data Entry

    Or maybe this is what you want ...
    Please Login or Register  to view this content.
    The code is added to the workbook as pb71 describes.
    Last edited by shg; 07-05-2010 at 12:31 PM.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    07-05-2010
    Location
    Tel Aviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Move Data One Cell to the Right after Data Entry

    Thanks for the quick response! For some reason it's not working for me though. I copy/ pasted the code into the worksheet in the view... and then saved. But still it is not changing to the next column.
    What am I possibly doing wrong?

  5. #5
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Move Data One Cell to the Right after Data Entry

    Would the 256 column constraint in Excel 2003 ever become an issue?

    EDIT:

    Just Googled it and the max. characters displayed in a cell is 1024, so the columns option would give you better history.
    Last edited by pb71; 07-05-2010 at 12:21 PM.

  6. #6
    Registered User
    Join Date
    07-05-2010
    Location
    Tel Aviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Move Data One Cell to the Right after Data Entry

    No no, it was something with the security level of the macros.... or something.
    But I just sorted it out and the code worked.
    Thanks for the help!

  7. #7
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Move Data One Cell to the Right after Data Entry

    Using shg's code:

    To account for the 256 column constraint in Excel 2003 by clearing the oldest date from column 256 (if necessary):

    Please Login or Register  to view this content.
    EDIT:
    A worse constraint of 1024 characters would apply to my code (less dates would be visible in the history), so I would have to truncate to 1006 characters at 1018 characters to allow for ", dd/mm/yyyy".
    Last edited by pb71; 07-06-2010 at 04:08 AM.

+ 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