+ Reply to Thread
Results 1 to 4 of 4

Pasting with VBA

  1. #1
    Registered User
    Join Date
    02-04-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Pasting with VBA

    Hi,

    I'm stumped on a couple of issues and would be grateful if anyone can offer a tip on either (or both!).

    I have some code which checks the values in column M of a sheet ("Timesheets Update") and if less than or equal to a specified value copies it across to another sheet ("Renewals").

    The problem is that it copies across the cell formula rather than actual cell value. I think I need to use pastespecial but can't get it to work properly.

    The second issue I have is that when it copies across it retains any blank rows (e.g. if only rows 5, 10 and 15 have values matching the specified criteria I end up with multiple blank rows between my results). Is there a way of avoiding this?

    Please Login or Register  to view this content.
    Thanks for any help.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Pasting with VBA

    See if this works.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Pasting with VBA

    FYI, your problem was that you were incrementing the value of d outside your if..end if clause, so it increased even if you didn't copy a row. You also don't need that Chr(64+j):
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Registered User
    Join Date
    02-04-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Pasting with VBA

    Many thanks to StephenR and Romperstomper for the help - works perfectly! Thanks.

+ 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