Rubber Beaked Woodpecker
Board Regular
- Joined
- Aug 30, 2015
- Messages
- 203
- Office Version
- 2021
Hi
I use the following code to copy prices on sheet1 and paste on sheet 7.
However I would also like to paste to sheets to sheets 8 and 9.
Is it possible to modify this code to do this?
Many thanks, RBW
I use the following code to copy prices on sheet1 and paste on sheet 7.
However I would also like to paste to sheets to sheets 8 and 9.
Is it possible to modify this code to do this?
Many thanks, RBW
VBA Code:
Sub logPrice()
Dim source As Worksheet
Dim destination As Worksheet
Dim emptyColumn As Long
Set source = Sheets("Sheet1")
Set destination = Sheets("Sheet7")
source.Range("Y5:Y16").Copy
emptyColumn = destination.Cells(44, destination.Columns.Count).End(xlToLeft).Column
If IsEmpty(destination.Range("A43")) Then
destination.Cells(1, 1).PasteSpecial Transpose:=True
Else
emptyColumn = emptyColumn + 1
destination.Cells(44, emptyColumn).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
End Sub