T
Trevor Williams
Hi All
I'm using a bit of code to copy formulae into blank cells using
'Selection.SpecialCells(xlCellTypeBlanks).Select'. I'm getting an error on
the occassions when there are no blank cells. I've tried using an On Error
statement but doesn't seem to work.
Any ideas how I get around the error msg?
Code below
Regards
Trevor Williams
Range("A1").CurrentRegion.Select
On Error GoTo CleanUp
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
also tried:
If Range("A1").CurrentRegion.SpecialCells(xlCellTypeBlanks).Select = True Then
Selection.FormulaR1C1 = "=R[-1]C"
End If
I'm using a bit of code to copy formulae into blank cells using
'Selection.SpecialCells(xlCellTypeBlanks).Select'. I'm getting an error on
the occassions when there are no blank cells. I've tried using an On Error
statement but doesn't seem to work.
Any ideas how I get around the error msg?
Code below
Regards
Trevor Williams
Range("A1").CurrentRegion.Select
On Error GoTo CleanUp
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
also tried:
If Range("A1").CurrentRegion.SpecialCells(xlCellTypeBlanks).Select = True Then
Selection.FormulaR1C1 = "=R[-1]C"
End If