Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Making A number AdvanceWith Each Cycle

Hi Minitman,

I just try your code every time the userform load it adds +1 to the dNum
values.

Your code was initialize the userform should be Userform_Activate.

Your save button should have a different code to activate the new value of
your dNum range.

It works okey using Userform_Activate. If you have time why not send to me
the excel file and I can fix it for you. Hope this helps.

"Minitman" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Making A number AdvanceWith Each Cycle

Hey Mel,

I found the error. It was in the area that cleared out the default
values of several of the TextBoxes. I had forgotten to remove the
reference to TB2, So every time I put a number into TB2, I was
immediately erasing it - Kind of dumb really!!!

Thanks for the reply.

-Minitman



On Sun, 2 Oct 2005 23:58:01 -0700, "Mel Arquiza"
wrote:

Hi Minitman,

I just try your code every time the userform load it adds +1 to the dNum
values.

Your code was initialize the userform should be Userform_Activate.

Your save button should have a different code to activate the new value of
your dNum range.

It works okey using Userform_Activate. If you have time why not send to me
the excel file and I can fix it for you. Hope this helps.

"Minitman" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? Charles A. Wilson Charts and Charting in Excel 1 December 17th 09 03:03 AM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM
making a number be text Fredrated Excel Worksheet Functions 2 June 1st 05 02:37 AM
Cycle Number Lock Steve Garman Excel Programming 0 May 4th 04 08:54 AM
making a cell fixed number to a input number fwday[_2_] Excel Programming 1 October 25th 03 02:38 AM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"