Hi,
I am encountering a problem in generating a serial number. Everytime i open the form the serial number always starts with "1" and on the second time i open the same form the serial number is generating correctly. I couldnt figure out what was wrong
I have this code on userform_initialize
[pre]
[/pre]
Thank you so much,
I am encountering a problem in generating a serial number. Everytime i open the form the serial number always starts with "1" and on the second time i open the same form the serial number is generating correctly. I couldnt figure out what was wrong
I have this code on userform_initialize
[pre]
Code:
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("ChangeControlRegister")
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With txtchange
.Value = Format(Val(Cells(Rows.Count, 1).End(xlUp)) + 1, "000")
.Enabled = False
End With
End sub
commandbutton1
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Call UserForm_Initialize
end sub
Thank you so much,