Hi all,
I have specified the area that I wish to copy and upon F8 throughout the code, I can see that it is selecting the copy area correctly. I cannot work out how to specify what the paste area should be. The copy area will always change, hence the use of the ActiveCell.Offset feature. I'm at a loss as to how to specify the paste area when the copy area changes each time.
In my code below, the first three rows are working fine but upon the 4th row, I get the following error.
Once the paste has occurred, I would like for row 8 down, to change the entries in the pasted are to be changed to a 1. I don't know how to specify the pasted area for this, either (same area as the line above).
Any help appreciated,
Moley84
I have specified the area that I wish to copy and upon F8 throughout the code, I can see that it is selecting the copy area correctly. I cannot work out how to specify what the paste area should be. The copy area will always change, hence the use of the ActiveCell.Offset feature. I'm at a loss as to how to specify the paste area when the copy area changes each time.
In my code below, the first three rows are working fine but upon the 4th row, I get the following error.
Once the paste has occurred, I would like for row 8 down, to change the entries in the pasted are to be changed to a 1. I don't know how to specify the pasted area for this, either (same area as the line above).
Any help appreciated,
Moley84
VBA Code:
sourceSheet.Rows(6).Find(What:="Calculated Activity Cost", LookAt:=xlWhole).Activate
ActiveCell.Offset(0, -1).Activate
sourceSheet.Range("I6", ActiveCell).EntireColumn.SpecialCells(xlCellTypeVisible).Copy
'The above three lines are fine. The next line is where I get the error
targetSheet.Range("h6" I DON'T KNOW WHAT TO SPECIFY HERE ).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=True, Transpose:=False
targetSheet.Range("h8" I DON'T KNOW WHAT TO SPECIFY HERE).Replace What:="*", Replacement:=1