Hi,
I'm trying to create a macro that looks at my source data, and if the data in a certain column (column B) contains either A,B, or C then it would copy the entire row over to another sheet. If it contained a blank or D,E, F, etc,etc then it would just ignore that and move to the next row.
I have found a macro that can do this, however I need to copy the values only and not the formulas. Below you can find a macro that I have found earlier which works really well. But the formulas are copied and I need the values. It would be great if anyone could help me.
Thanks a lot!
Sub acopy()
SrcLR = Application.Match("*", Sheets("source").Range("B:B"), -1)
DestLR = Application.CountA(Sheets("final").Range("B:B"))
For i = 1 To SrcLR
b = UCase(Sheets("source").Cells(i, "B"))
If b = "A" Or b = "B" Or b = "C" Then
DestLR = DestLR + 1
Sheets("source").Cells(i, 1).EntireRow.Copy Sheets("final").Cells(DestLR, 1)
End If
Next i
End Sub
I'm trying to create a macro that looks at my source data, and if the data in a certain column (column B) contains either A,B, or C then it would copy the entire row over to another sheet. If it contained a blank or D,E, F, etc,etc then it would just ignore that and move to the next row.
I have found a macro that can do this, however I need to copy the values only and not the formulas. Below you can find a macro that I have found earlier which works really well. But the formulas are copied and I need the values. It would be great if anyone could help me.
Thanks a lot!
Sub acopy()
SrcLR = Application.Match("*", Sheets("source").Range("B:B"), -1)
DestLR = Application.CountA(Sheets("final").Range("B:B"))
For i = 1 To SrcLR
b = UCase(Sheets("source").Cells(i, "B"))
If b = "A" Or b = "B" Or b = "C" Then
DestLR = DestLR + 1
Sheets("source").Cells(i, 1).EntireRow.Copy Sheets("final").Cells(DestLR, 1)
End If
Next i
End Sub