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 usebut this produces an invalid outside procedure msgbx.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
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks