Public Sub Workbook_Open()
Call test
ThisWorkbook.Save
End Sub
Sub test()
Dim c, d, i
For c = 2 To 65536
If Range("A" & c) = 0 Then
d = c - 1
i = Range("A" & d)
GoTo 10
End If
Next c
10 Range("A" & i + 1) = i + 1
End Sub
Private Sub Workbook_Open()
Sheets("Sheet1").[A1] = Sheets("Sheet1").[A1] + 1
ThisWorkbook.Save
End Sub
thanks unnilennium78
im getting a compile error
am i doing somthing wrong?
jay