View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Code Help Needed


"NEWER USER" skrev i en meddelelse
...
I need to fill a Column (B) with a value of "1" in every cell that is null
up
to the last row having a value in Column (A). There are no empty cells in
column A up to the last row with data in the spreadsheet. I can not
accomplish through a recorded macro. Can anybody help me with some coding
to
accomplish this task? Thank you


Hi

Sub FillColB()
Dim tRange As Range
Dim c
Set tRange = Range("A1", Range("A1").End(xlDown))

For Each c In tRange
If c.Value < "" Then c.Offset(0, 1).Value = 1
Next
End Sub

regards,

Per