ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User forms - How do I...? (https://www.excelbanter.com/excel-programming/392102-user-forms-how-do-i.html)

Jock

User forms - How do I...?
 
Change the font size within a text box?
Automatically have the form appear when the spreadsheet is opened?
Have a running total (from the spreadsheet behind the form) visible on the
form: i.e. total cost?
Have the days date automatically inserted in the appropriate field when form
opened?
Have an error message appear when any of the text boxes have not been
populated by the user?

A few things to be going on with there....

--
tia

Jock

[email protected]

User forms - How do I...?
 
On Jun 26, 11:51 am, Jock wrote:
Change the font size within a text box?
Automatically have the form appear when the spreadsheet is opened?
Have a running total (from the spreadsheet behind the form) visible on the
form: i.e. total cost?
Have the days date automatically inserted in the appropriate field when form
opened?
Have an error message appear when any of the text boxes have not been
populated by the user?

A few things to be going on with there....

--
tia

Jock



Jock,

You might want to pick up a VBA book or do some more searching in the
group so that you can get a feel for how to write code for user forms.

User forms are like everything else in VBA code--it's object
oriented. One way to think of it is that the user form is the object
and the radio buttons, text boxes, etc. are properites of the object.
So, if you do something like UserForm1.TextBox1.Value, you will get
the corresponding value contained in the text box that is named
"TextBox1" on the user form named "UserForm1". If you want to change
a specific property of a text box, then you can simply select the text
box, go to the Properties Window, and find the corresponding property
you wan to change. Also, you can input information from the user form
into the spreadsheet by using the object hierarchy. Something like
Range("A1").Value = UserForm1.TextBox1.Value will input the value in
"TextBox1" from "UserForm1" into "Range("A1")".

Hopefully this is a good enough start for you. Good Luck with your
research. Don't forget to use the VBE Help and the Object Browser.

Matt


Jock

User forms - How do I...?
 
Thanks Matt, I thought when I was writing all my questions that I was asking
for a lot! I think I do need do delve deeper into the vba code aspect and
actually learn how it works.
Cheers

Jock


" wrote:

On Jun 26, 11:51 am, Jock wrote:
Change the font size within a text box?
Automatically have the form appear when the spreadsheet is opened?
Have a running total (from the spreadsheet behind the form) visible on the
form: i.e. total cost?
Have the days date automatically inserted in the appropriate field when form
opened?
Have an error message appear when any of the text boxes have not been
populated by the user?

A few things to be going on with there....

--
tia

Jock



Jock,

You might want to pick up a VBA book or do some more searching in the
group so that you can get a feel for how to write code for user forms.

User forms are like everything else in VBA code--it's object
oriented. One way to think of it is that the user form is the object
and the radio buttons, text boxes, etc. are properites of the object.
So, if you do something like UserForm1.TextBox1.Value, you will get
the corresponding value contained in the text box that is named
"TextBox1" on the user form named "UserForm1". If you want to change
a specific property of a text box, then you can simply select the text
box, go to the Properties Window, and find the corresponding property
you wan to change. Also, you can input information from the user form
into the spreadsheet by using the object hierarchy. Something like
Range("A1").Value = UserForm1.TextBox1.Value will input the value in
"TextBox1" from "UserForm1" into "Range("A1")".

Hopefully this is a good enough start for you. Good Luck with your
research. Don't forget to use the VBE Help and the Object Browser.

Matt




All times are GMT +1. The time now is 09:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com