+ Reply to Thread
Results 1 to 6 of 6

code required to copy and paste rows matching a criteria.

  1. #1
    Registered User
    Join Date
    07-24-2008
    Location
    UK
    Posts
    9

    code required to copy and paste rows matching a criteria.

    Hi all,

    Im sure this is pretty simple but cant figure it out for the life of me...

    All I require is either a code or formula that will recognize if there is a '1' in Column AH of 'Sheet1' and if so copy and paste the row containing the '1' into 'Sheet4'. This row can then be deleted from 'Sheet1'.

    Thanks for any answers in advance..

  2. #2
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Hi Duguid1,

    You could give this code a try. It finds out the last cell in Sheet 1, the last cell in Sheet 4, and copies the relevant row (if Cell AH1 contains "1") from Sheet 1 to the last row in Sheet 4

    Please Login or Register  to view this content.
    Hope this helps

    Seamus

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Filter the data then Cut & Paste
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    02-22-2007
    Posts
    47
    Please Login or Register  to view this content.
    Can you actually Dim Variables like this? I think that "lastRowSource" didn't get declared. Correct me if I am wrong...

  5. #5
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Hi kyrgyzstanart,

    You're right enough. It was a typo on my part. Thanks for that
    Last edited by SOS; 07-29-2008 at 10:35 AM.

  6. #6
    Registered User
    Join Date
    07-24-2008
    Location
    UK
    Posts
    9
    yes, it works now, thanks for your help!

+ 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