View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
shockley shockley is offline
external usenet poster
 
Posts: 135
Default Finding last non-empty column in row...

MsgBox Cells(Columns.Count, "2").End(xlLeft).Column

should be xlToLeft rather than xlLeft

"Mika" wrote in message
...
This code works fine:
MsgBox Cells(Rows.Count, "A").End(xlUp).Row

But this does not:
MsgBox Cells(Columns.Count, "2").End(xlLeft).Column

Any ideas how it should be changed to work?

Thanks!
Mika.