View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Minitman[_4_] Minitman[_4_] is offline
external usenet poster
 
Posts: 273
Default Making A number AdvanceWith Each Cycle

Greetings,

I nave a UserForm that has an item number that is supposed to advance
with each new item. It doesn't!!!

Maybe one of you could look at my code and let me know what I did
wrong.

Private Sub UserForm_Initialize()

If Range("dNum").Value = "" Then
Range("dNum").Value = 1
TB2.Value = Range("dNum").Value
Range("dNum").Value = Range("dNum").Value + 1
Else
TB2.Value = Range("dNum").Value
Range("dNum").Value = TB2.Value + 1
TB2.TabStop = False
End If

End Sub

dNum is a place holder for this number. TB2 is the TextBox on the
UserForm for the number which is pasted down when the user clicks on
the Save button. The Save button also closes the UserForm and then
restarts it - Cycling.

Any ideas on what is wrong with this code? Or ideas on what to
replace it with?

Any help would be most appreciated.

TIA

-Minitman