+ Reply to Thread
Results 1 to 2 of 2

Copy Cells to another sheet if information in the row matchs

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Earth
    MS-Off Ver
    Excel 2013
    Posts
    33

    Copy Cells to another sheet if information in the row matchs

    TEST1.xlsm

    hi im trying to copy the first cell in the row of data from one sheet to another when another cell in that row = 1

    see attached docuemnt

    i want to end up on sheet 2 with one list of items from the first list that have an item type of 1

    code i have so far is below it doe does not work to well

    first part deleting existing data needs expanding to say if there is no data dont delete as it errors if it tries to delete empty table

    second error is when you try and copys

    please point out where i need to improve the code

    thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy Cells to another sheet if information in the row matchs

    add:

    Dim nxtrow as long

    modify:

    if lrow1>=4 then Worksheets("Second").Range("A4:A" & lrow1).Delete

    i think you mean:

    Worksheets("first").Range("A" & Item.Row).Copy_
    Destination = Worksheets("second").Range("A" & NxtRow) instead of "A4"&nxtrow

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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