+ Reply to Thread
Results 1 to 6 of 6

macro VB

  1. #1
    Registered User
    Join Date
    05-14-2008
    Posts
    18

    macro VB

    here goes...

    ive attached a VB for a macro which copys cells and then pastes them somewhere else. after this is done i select the line below the pasted cells and colour black and then the line below that and colour that black.

    my macro doesnt find the next new line. it simply keeps overwriting existing data.


    can anyone help.

    thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Ok, so removing the scrolling, your code is as follows:
    Please Login or Register  to view this content.
    How is K696 determined to be the starting point of pasting the copied data? Is K695 the last used cell?

  3. #3
    Registered User
    Join Date
    05-14-2008
    Posts
    18

    Re:

    cell k696 is the cell that i click on when i paste the copied cells.

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Well, I understand that based on your code. However, if you want VBA to know which cell to copy the cells, then there must be some criteria you used to determine K696 was the cell to which to paste.

    So what I gather, it sounds like you would like the next instance to copy into cell K712, correct? This would be 1 blank row after your data, then 2 rows that are black, then 1 blank row, then the new data?

    Also, will you always be copying cells K43:P54, or will you be copying cells that you select?

  5. #5
    Registered User
    Join Date
    05-14-2008
    Posts
    18

    R:

    i will always be copying cells K43:P54

    the next instance may not be k712 as the data range can vary.

    the macro needs to find the next unused horizontal line. miss that line and paste the cells.then miss that line and then 1 row that is black and then 1 row that is yellow.

    thanks.

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    See if this will work for you:

    Please Login or Register  to view this content.
    Jason

+ 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