Hey Guys,
I need help.
This question is however cross posted .
here is the link :
https://www.excelforum.com/excel-pr...-filter-modifying-formulae-2.html#post4942600
I have this code to filter sheet "PRODUCT" based on column "IN STOCK"
If cell matches "INSTOCK" then it is copied to sheet "stock in hand"
Now the problem is that the vba code clears the entire used range.
If it possible that to add an exception - to not clear upto row 6?
Because if i enter any data in row 1-6, then it autoclears it
Here is the vba code to edit
Please help me
I need help.
This question is however cross posted .
here is the link :
https://www.excelforum.com/excel-pr...-filter-modifying-formulae-2.html#post4942600
I have this code to filter sheet "PRODUCT" based on column "IN STOCK"
If cell matches "INSTOCK" then it is copied to sheet "stock in hand"
Now the problem is that the vba code clears the entire used range.
If it possible that to add an exception - to not clear upto row 6?
Because if i enter any data in row 1-6, then it autoclears it
Here is the vba code to edit
Code:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">Private Sub Worksheet_Activate()
Me.UsedRange.Clear
With Worksheets("PRODUCT")
.[Z1:Z2].Value = [{"stock in hand";"IN STOCK"}]
.Cells(5, 1).ListObject.Range.AdvancedFilter xlFilterCopy, .[Z1:Z2], Cells(7,1)
.[Z1:Z2].Clear
End With
End Sub</code>
Please help me