Hi, fairly new to VBA,
I have 5 worksheets where I have to filter and copy data from column B, C
and D to another worksheet (named: Customers) in same workbook.
Have got the code to move what data I want but need the data in each
worksheet to go into the Customers worksheet by filling in from the next
blank cell. If I copy data from worksheet A it holds but then when I copy
data from worksheet B it copies over the data...I need code please to take
the data from the each worksheet and just copy it down: My code is set as:
Sub CopySignificant()
'Copy cells of cols A,F,E,D from rows containing "Significant" in
'col D of the active worksheet (source sheet) to cols
'A,B,C,D of Sheet2 (destination sheet)
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("Customers")
Dim sRow As Long 'row index on source worksheet
Dim dRow As Long 'row index on destination worksheet
Dim sCount As Long
sCount = 0
dRow = 1
For sRow = 1 To Range("G57").End(xlUp).Row
'use pattern matching to find "Significant" anywhere in cell
If Cells(sRow, "G") Like "*GIRO*" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,F,E & D
DestSheet.Cells(dRow, "A") = Cells(sRow, "B")
DestSheet.Cells(dRow, "B") = Cells(sRow, "C")
DestSheet.Cells(dRow, "C") = Cells(sRow, "D")
End If
Next sRow
MsgBox sCount & " Giro Customers copied", vbInformation, "Transfer Done"
End Sub
This appears in each worksheet, can anyone help?
Thanks
Craigos