Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Default in a textbox and change a module name

2 questions:
1)
I have a form that ask the user for the bill number (a 10 numbers
number),and the user needs to type all the numbers each time that a bill is
done, so I want to use a default value in the textbox1 linked to the last
value (that is saved in a cell c5) + 1, (in cell c1 appears 0889888881 so in
the textbox appears 0889888882)
Pd. I know that this can be done automatically, but because there is some
time that bills are cancelled I need to ask the user for the bill number.
Pd2. I know that default value is an option on inputbox property, but I
cant use inputbox because my form has a lot of buttons¡¡¡¡¡¡

2)
There is some way to change the module names (instead of module1 say
easyprgms1) and also to lookup for a specific sub (because I have 100 subs
and each time I need to modify something I need to check in each of the 15
modules that I have)

Tanks for your Help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Default in a textbox and change a module name

Do you have a list of Bill Numbers

to reduce errors, why not use a combobox and let the user select the Bill
number.

otherwise

Private Sub Userform_Activate()
Textbox1.Text = format(Worksheets("Sheet1") _
.Range("C5") + 1,"0000000000")
End Sub


In the project explorer, select the module and look in the properties window
(F4 if it isn't visible) Replace ModuleX with the name you want. (Name is
the only property)

--
Regards,
Tom Ogilvy

"filo666" wrote in message
...
2 questions:
1)
I have a form that ask the user for the bill number (a 10 numbers
number),and the user needs to type all the numbers each time that a bill

is
done, so I want to use a default value in the textbox1 linked to the last
value (that is saved in a cell c5) + 1, (in cell c1 appears 0889888881 so

in
the textbox appears 0889888882)
Pd. I know that this can be done automatically, but because there is some
time that bills are cancelled I need to ask the user for the bill number.
Pd2. I know that default value is an option on inputbox property, but I
cant use inputbox because my form has a lot of buttons¡¡¡¡¡¡

2)
There is some way to change the module names (instead of module1 say
easyprgms1) and also to lookup for a specific sub (because I have 100 subs
and each time I need to modify something I need to check in each of the 15
modules that I have)

Tanks for your Help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Default in a textbox and change a module name

thaknd tom, I have another question, what is an event?, I found this term in
tge class chapter of my "VB for Dummies book"¡¡¡¡¡

TIA
"Tom Ogilvy" wrote:

Do you have a list of Bill Numbers

to reduce errors, why not use a combobox and let the user select the Bill
number.

otherwise

Private Sub Userform_Activate()
Textbox1.Text = format(Worksheets("Sheet1") _
.Range("C5") + 1,"0000000000")
End Sub


In the project explorer, select the module and look in the properties window
(F4 if it isn't visible) Replace ModuleX with the name you want. (Name is
the only property)

--
Regards,
Tom Ogilvy

"filo666" wrote in message
...
2 questions:
1)
I have a form that ask the user for the bill number (a 10 numbers
number),and the user needs to type all the numbers each time that a bill

is
done, so I want to use a default value in the textbox1 linked to the last
value (that is saved in a cell c5) + 1, (in cell c1 appears 0889888881 so

in
the textbox appears 0889888882)
Pd. I know that this can be done automatically, but because there is some
time that bills are cancelled I need to ask the user for the bill number.
Pd2. I know that default value is an option on inputbox property, but I
cant use inputbox because my form has a lot of buttons¡¡¡¡¡¡

2)
There is some way to change the module names (instead of module1 say
easyprgms1) and also to lookup for a specific sub (because I have 100 subs
and each time I need to modify something I need to check in each of the 15
modules that I have)

Tanks for your Help




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Default in a textbox and change a module name

In writing the code for Excel, the authors have defined certain "Events".
This is code that will call code you design and tie to this event. For
example, manually editing a cell in Excel triggers a call to the
worksheet_Change event. If I put code in that event declaration or put a
call to one of my macros in the event declaration, whenever a cell is
edited, the event will be executed and my code will in turn be executed.

See Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

The Activate event for a userform is fired whenever the userform is
activated.

If you go into the Userform code module, in the left dropdown select
Userform and in the right dropdown (at the top of the module), select
Activate.

--
Regards,
Tom Ogilvy


"filo666" wrote in message
...
thaknd tom, I have another question, what is an event?, I found this term

in
tge class chapter of my "VB for Dummies book"¡¡¡¡¡

TIA
"Tom Ogilvy" wrote:

Do you have a list of Bill Numbers

to reduce errors, why not use a combobox and let the user select the

Bill
number.

otherwise

Private Sub Userform_Activate()
Textbox1.Text = format(Worksheets("Sheet1") _
.Range("C5") + 1,"0000000000")
End Sub


In the project explorer, select the module and look in the properties

window
(F4 if it isn't visible) Replace ModuleX with the name you want. (Name

is
the only property)

--
Regards,
Tom Ogilvy

"filo666" wrote in message
...
2 questions:
1)
I have a form that ask the user for the bill number (a 10 numbers
number),and the user needs to type all the numbers each time that a

bill
is
done, so I want to use a default value in the textbox1 linked to the

last
value (that is saved in a cell c5) + 1, (in cell c1 appears 0889888881

so
in
the textbox appears 0889888882)
Pd. I know that this can be done automatically, but because there is

some
time that bills are cancelled I need to ask the user for the bill

number.
Pd2. I know that default value is an option on inputbox property, but

I
cant use inputbox because my form has a lot of buttons¡¡¡¡¡¡

2)
There is some way to change the module names (instead of module1 say
easyprgms1) and also to lookup for a specific sub (because I have 100

subs
and each time I need to modify something I need to check in each of

the 15
modules that I have)

Tanks for your Help






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Default in a textbox and change a module name

An event is something that happens. Modern languages allow you to monitor
and act upon events.

For instance, opening a workbook is an event. VBA allows code to be written
that is triggered by that event, and allows the developer to take action
based upon that workbook opening.

Other such events are a worksheet being activated, a cell being selected, a
cell being changed.

In your book, being VB, it probably won't cover Excel events, but should
cover form control events. Forms will have controls, such as checkboxes,
textboxes, command buttons. They would be useless until you were able to
code based upon something happening to them, so many events for the controls
are exposed, such as the click event, change event, etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"filo666" wrote in message
...
thaknd tom, I have another question, what is an event?, I found this term

in
tge class chapter of my "VB for Dummies book"¡¡¡¡¡

TIA
"Tom Ogilvy" wrote:

Do you have a list of Bill Numbers

to reduce errors, why not use a combobox and let the user select the

Bill
number.

otherwise

Private Sub Userform_Activate()
Textbox1.Text = format(Worksheets("Sheet1") _
.Range("C5") + 1,"0000000000")
End Sub


In the project explorer, select the module and look in the properties

window
(F4 if it isn't visible) Replace ModuleX with the name you want. (Name

is
the only property)

--
Regards,
Tom Ogilvy

"filo666" wrote in message
...
2 questions:
1)
I have a form that ask the user for the bill number (a 10 numbers
number),and the user needs to type all the numbers each time that a

bill
is
done, so I want to use a default value in the textbox1 linked to the

last
value (that is saved in a cell c5) + 1, (in cell c1 appears 0889888881

so
in
the textbox appears 0889888882)
Pd. I know that this can be done automatically, but because there is

some
time that bills are cancelled I need to ask the user for the bill

number.
Pd2. I know that default value is an option on inputbox property, but

I
cant use inputbox because my form has a lot of buttons¡¡¡¡¡¡

2)
There is some way to change the module names (instead of module1 say
easyprgms1) and also to lookup for a specific sub (because I have 100

subs
and each time I need to modify something I need to check in each of

the 15
modules that I have)

Tanks for your Help






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
Module of VB sets as default on Excel sohraaz Excel Discussion (Misc queries) 1 July 21st 07 02:24 PM
Changing Default Module Location Ron Dahl[_2_] Excel Programming 1 October 1st 04 04:13 AM
Class module to filter textbox entry Shawn[_9_] Excel Programming 7 August 20th 04 12:53 PM
Textbox in Userform not recognised by Module SuperJas Excel Programming 5 February 26th 04 07:11 PM
set a default value on textbox Dave Excel Programming 3 February 19th 04 10:17 AM


All times are GMT +1. The time now is 08:00 AM.

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

About Us

"It's about Microsoft Excel"