Copy Paste Special Value using Code over Several Worksheets

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top