+ Reply to Thread
Results 1 to 2 of 2

Macro - Process Next Record

  1. #1
    Registered User
    Join Date
    05-11-2007
    Posts
    16

    Macro - Process Next Record

    Okay this has to be easy but…….

    I have a spreadsheet that is basically set out like this.
    A B C D
    1 Date 02/07/2007
    2 Processed Case No
    3 02/07/2007 1
    4 2
    5 3
    6 4
    7 5
    8 6
    9 7
    10 8

    I am trying to write a macro that will pick up the date from a fixed cell D1 and paste it into the particular case that I am working with then move the active cell to the next case in the list. I have been using the Record Macro facility which works fine in that it always goes to cell D1 and selects the date but instead of pasting it to the cell adjacent to my starting point it pastes it to Cell A3 and then makes Cell B4 the active cell (exactly what I did when I recorded the Macro). I need the Marco to remember which Cell was active before I run the Macro and to paste the date in the cell immediately to the left of it, then make the cell below where I started the active cell.

    This must be a common process – My failed code is as below - Can anyone out with what it should be please.

    ========================
    Sub Macro5()
    '
    ' Macro5 Macro
    ' Macro recorded 02/07/2007 by theoldgit
    '
    ' Keyboard Shortcut: Ctrl+k
    '
    Range("D1").Select
    Selection.Copy
    Range("A3").Select
    ActiveSheet.Paste
    Range("B4").Select
    End Sub

    ===================================

    Thanks

  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
    Please read forum rules below and then wrap your code

    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 !!!

+ 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