I have a file that is set up as a pricing list. Column 10 is the one where quantities are written own and it automatically calculates the price.
However, is there a way of only transferring those rows which have had products selected onto a second worksheet, in order to make a "summary invoice"?
I'll be honest, I'm a complete amateur at VBA so tried the following after attempting to edit someone else's code, but it's not working.
However, is there a way of only transferring those rows which have had products selected onto a second worksheet, in order to make a "summary invoice"?
I'll be honest, I'm a complete amateur at VBA so tried the following after attempting to edit someone else's code, but it's not working.
Code:
Sub RemoveErrors()
Application.ScreenUpdating = False
Dim LastRow As Long
Dim BadRow As Range
LastRow = Cells(Rows.Count, "G").End(xlUp).Row
Sheets("Sheet1").Select
Range("G3" & LastRow).Select
For Each BadRow In Range("G3" & LastRow)
Select Case BadRow.Value
Case "1"
BadRow.EntireRow.Select
Selection.Cut
Sheets("Sheet2").Select
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste
Case "2"
BadRow.EntireRow.Select
Selection.Cut
Sheets("Sheet2").Select
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste
End Select
Next BadRow
End Sub