View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Number Cells, Excel 2000 & 2003

Try this

Sub mersible()
x = 1
With ActiveSheet
lastrow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
Set myrange = Range("A1:A" & lastrow)
myrange.Select
For Each c In myrange
c.Select
If ActiveCell.Offset(0, 1).Value = "" Then
ActiveCell.Value = x
x = x + 1
End If
Next
End Sub

Mike

"jfcby" wrote:

Hi,

A macro could do that in several ways but what do you want it to do as it
counts down the column?

Mike


I want column 1 cells to have sequential numbers if column 2 same
cells has data in it. If column 2 cell is blank I want column one same
cell blank.

Thank you for your help,
jfcby