Hopefully someone can help me with this one.
I have a spreadsheet that we use a VBA userform to input and update the data.
column "a" of the worksheet is named SLNUM, and the entries here mirror the excel row numbers.
when the form loads, it displays the next (blank) available number, and this is displayed in a textbox on the userform.
I have created a button which runs the following code to update the textbox, SLNRESET is the button name
' reset SL number
Private Sub SLNRESET_Click()
With slnum
.Value = Format(Val(Range("A" & Rows.Count).End(xlUp)) + 1, "00000")
.Enabled = True
End With
end Sub
Is there any way to make this code run every 30 seconds, as when users forget to click the button they can create duplicate line numbers.
I've included the top of the form for reference.
Thanks
I have a spreadsheet that we use a VBA userform to input and update the data.
column "a" of the worksheet is named SLNUM, and the entries here mirror the excel row numbers.
when the form loads, it displays the next (blank) available number, and this is displayed in a textbox on the userform.
I have created a button which runs the following code to update the textbox, SLNRESET is the button name
' reset SL number
Private Sub SLNRESET_Click()
With slnum
.Value = Format(Val(Range("A" & Rows.Count).End(xlUp)) + 1, "00000")
.Enabled = True
End With
end Sub
Is there any way to make this code run every 30 seconds, as when users forget to click the button they can create duplicate line numbers.
I've included the top of the form for reference.
Thanks