View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default if not empty cells skip

if you're selecting the row AFTER the last used row, then surely its blank
anyways??
whats the point of the code?

"Miree" wrote:

I have this section of code which has been working fine, up until now, when i
try to run it it highlights the third line, I think this is because sometimes
there are no empty cells where i am trying to run it, can i get it to ignore
the code only if there are no empty cells?

lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Range("B" & lngLastRow + 1 & ":DY" & lngLastRow + 1).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = ".."