+ Reply to Thread
Results 1 to 2 of 2

Thread: Transferring data based on critrea

  1. #1
    Registered User
    Join Date
    07-07-2009
    Location
    Wilkie, Saskatchewan
    MS-Off Ver
    Excel 2003
    Posts
    21

    Transferring data based on critrea

    I have a worksheet that shows my monthly inventory, some of my items are shipped by bulk, others shipped by bag, For each month I enter our shipping data, in column "A" is the date, column "B" is the weight, then the info in B is transfered into the column of the appriorate commodity, then the type of shipment is noted with an "*" after this info is enetered I need to transfer it to another work sheet that gives me a monthly report of bulk and bagged shipments, The commodity must be transferred to the corrsponding column on the second sheet based on commodity and packing type. This is code that i was tryin to use
    sub_range
    Dim Cell As Range
    For Each Cell In Range("d4:d269")
    If Cell = "*" Then Cell.Copy ("c4:c269"), Destination = Worksheet("shippinginventory").Range("b2:b267")
    
    Next
    End Sub
    but this produces an invalid outside procedure msgbx.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    448

    Re: Transferring data based on critrea

    you code should be something like this

    sub_range
    Dim Cell As Ran
    worksheets("January ").activate
    For Each Cell In Range("d4:d269")
    If Cell = "*" Then cell.entirerow.copy worksheets("shippinginventory").cells(rows.count,"A").end(xlup).offset(1,0)
    Next
    End Sub


    the statement if cell="*" .........offset(1,0) should be in one line
    In this revised code you are testing whether there are any cell in the column (D4 to D269) only and if any cell in this column or range is * then the entire row is copied in the sheet "shippinginventory" in the first available row. But it doe NOT test the column H. how many such columns are there?
    Last edited by venkat1926; 02-14-2010 at 06:55 AM.

+ 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.2.0