View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jef Gorbach[_2_] Jef Gorbach[_2_] is offline
external usenet poster
 
Posts: 65
Default Fill column question

You could also assign the entire range at once since every cell is
getting the same value. Change A65536 to whatever is your longest
column.

Sub Test()
ActiveSheet.Range("J2","J"&Range("A65536").End(xlu p).row).Value=0
End Sub

Alternately, consider assigning the last row number to a variable to
make your code easier to comprehend, especially if you need to
references it in several places; like so:

Sub Test()
Lastrow = Range("A65536").End(xlup).row
ActiveSheet.Range("J2","J"&Lastrow).Value=0
End Sub