J
John
I want to copy paste special values that I have based on looking up a date
(in C.O.S H4) and then pasting and copying directly in the same sell over
various worksheets, startng in worksheet Sales. The value in C.O.S H4 that I
am looking for in each worksheet might not always be in Column A
I've managed to do this for one worksheet but can't seem to do it for more
than one How can I join several of these codes together?
The code I'm using and works great for just one area is
Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
dTest = Worksheets("C.O.S").Range("H4").Value
For Each wsSheet In Sheets(Array("Sales"))
With wsSheet
For Each rCell In .Range("A3:A" & .Range("A" &
Rows.Count).End(xlUp).Row)
If rCell.Value = dTest Then
With rCell.Offset(0, 1).Resize(, 26)
.Value = .Value
End With
End If
Next rCell
End With
Next wsSheet
End Sub
(in C.O.S H4) and then pasting and copying directly in the same sell over
various worksheets, startng in worksheet Sales. The value in C.O.S H4 that I
am looking for in each worksheet might not always be in Column A
I've managed to do this for one worksheet but can't seem to do it for more
than one How can I join several of these codes together?
The code I'm using and works great for just one area is
Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
dTest = Worksheets("C.O.S").Range("H4").Value
For Each wsSheet In Sheets(Array("Sales"))
With wsSheet
For Each rCell In .Range("A3:A" & .Range("A" &
Rows.Count).End(xlUp).Row)
If rCell.Value = dTest Then
With rCell.Offset(0, 1).Resize(, 26)
.Value = .Value
End With
End If
Next rCell
End With
Next wsSheet
End Sub