Copy all out items from sheet1 to sheet2.

bentxoxo

New Member
Joined
Jan 13, 2016
Messages
29
Hi All,

I am completely new to this site and <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>.

Could someone help me with how I can create the <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> in excel to do the followings?

From sheet1 find "out of stock" / "discontinue" items and copy item code,item name to sheet2, do this until all out/dis item are listed in sheet2.

We have more that 4000 items and it's very difficult to remember all of the out of stock / discontinue items. Having this VBA will save lots of time spend on manual editing.

I would be really grateful for your supports!!!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Dom,
Thanks for your reply. I tried filter but it doesn't work as I have multiple items in same row like A,B,C have different product range and D,E,F have different product range as you can see below "sheet1". I would to great if I have VBA which can copy all the out/dis products from whole sheet1 to sheet2.

Sheet1:
ITEMITEM CODEQTYTESTERQTYITEMITEM CODEQTYTESTERQTYITEMITEM CODEQTYTESTERQTYITEMITEM CODEQTYTESTERQTY
Shocking pink1111111TEyeliner Black2222Face Wash5555
fuchia pink1112112TOUTMascara Black2223223TCleansing Milk3333Face Scrub5556OUT556T
red velvet1113OUT113TBlackest/Black2224224TDual Action Cleanser3334Moisturiser5557557TDIS
copper red1114114TVolume Black2225225TDISToner3335Moisturiser5558DIS558Tdis
wild pink1115OUT115TVol Brown/Black2226226TDISDaily Moist3336OUT336TMoisturiser5559out559TDIS
old rose1116116TBlack Rose2227DIS227TOUTMoisture Treat3337OUT337ToutEye Serum5560
bloom pink1117117TDISMascara Black2228228TNight Cream3338OUTDeodorant5561
hot pink1118OUT118TEYE-3Day Cream3339339TBody Wash5562dis
pinky orange1119119TEye Cream3340340TdisShave Gel5563OUT563TDIS

<tbody>
</tbody>

Sheet2:
OUT OF STOCK
Item CodeNameExpected Delivery
1113red velvet20-Jan-16
1118hot pinkJan End

<tbody>
</tbody>
Thanks
 
Upvote 0
I can't access that but the code would be something like this:

Code:
Sub Macro1()        
    Dim rngLoopRange As Range
    
    For Each rngLoopRange In Sheets("Sheet1").Range("C2:C10,H2:H10,L2:L10,S2:S10")
        If UCase(rngLoopRange) = "OUT" Then
            With Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
                .Value = rngLoopRange.Offset(0, -1)
                .Offset(0, 1) = rngLoopRange.Offset(0, -2)
            End With
        End If
    Next rngLoopRange
    
End Sub

You'd find it much easier to do analysis on your data if it was all kept together rather than split up across the sheet.

Dom
 
Upvote 0
Hi Dom,

That worked perfectly like a charm with little tweep n tweak. I can't thank you enough on how much you saved my time and manual copy / paste.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,916
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top