Hi,
I'm after a bit of help please, I wrote this code some 17 years ago and it works fine until now as column D no has formulas in so it is not going to the last row with data in it as I assume it doesn't think the cell is empty because of the formula.
Any way around this please?
The bit causing the problem is highlighted red.
I'm after a bit of help please, I wrote this code some 17 years ago and it works fine until now as column D no has formulas in so it is not going to the last row with data in it as I assume it doesn't think the cell is empty because of the formula.
Any way around this please?
The bit causing the problem is highlighted red.
Rich (BB code):
Case Else
With WS
myRow = wsQuote.Range("B65536").End(xlUp).Row
.Range("J7:K7").Copy
wsQuote.Cells(myRow + 4, 1).PasteSpecial Paste:=xlValues
wsQuote.Cells(myRow + 4, 1).PasteSpecial Paste:=xlFormats
myRow = wsQuote.Range("B65536").End(xlUp).Row
.Range("J9:K35").Copy
wsQuote.Cells(myRow + 2, 1).PasteSpecial Paste:=xlValues
wsQuote.Cells(myRow + 2, 1).PasteSpecial Paste:=xlFormats
myRow = wsQuote.Range("B65536").End(xlUp).Row
LastRow = WS.Range("D65536").End(xlUp).Row
.Range("B40:D" & LastRow).Copy
wsQuote.Cells(myRow + 2, 1).PasteSpecial Paste:=xlValues
wsQuote.Cells(myRow + 2, 1).PasteSpecial Paste:=xlFormats
'Set print areas
LastRow = WS.Range("D65536").End(xlUp).Row
'.Range("B1:H" & LastRow).Select
.PageSetup.PrintArea = "B1:H" & LastRow + 6
End With