ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trying my first user form..... (https://www.excelbanter.com/excel-programming/411630-trying-my-first-user-form.html)

SteveDB1

trying my first user form.....
 
Hi all.
After tinkering for a long while with macros-- mostly with help from many of
you-- I've decided to try my hand at user forms.
Some of the macros I have have multiple input boxes, and I'd like to reduce
the amount of them, and have all the input on a single form.
I've made the forms using the drag/drop toolbox, and now have to figure out
what's next?
I've found where I can change the names of the components in the property
box, and that will allow me to "link" the variable names I've given to my
macro elements. myRng_n, myCell_n, etc...... where _n is the number/letter
I've assigned to the given variable.

But after that.... I'm lost. And yes, I'll admit part of this is somewhat
intimidating, but since I've come this far, I have found I'm willing to let
go of that, and move forward......

My questions are-- trying not to be too general, yet general enough to get
the info I need-- what do I do next?

1- do I place the code elements for my variables within the sub for each
inputbox (of the same name) of the form? I.e., how do I link the macro input
demands to the form inputs?

2- how do I activate/cancel the form? From what I've tried thus far, it
seems that I need to place the entire sub (for my macro) within the
cmd_click_ok sub. Is there some basic code that activates the macro with that
button? Similarly, is there some code that cancels when I click cancel?

3- ultimately, my goal will be to take some old C++ code that I've written,
and make a windows program out of it using forms, etc.... (I took a C++ class
7-1/2 years ago, and we got to the very beginning of functions/classes. On my
own, I began tinkering with forms, but never got far enough to understand
what I was doing, and have found that it's now limiting my abilities in
programming, and moving forward.).

If this is going to be too complicated to explain here, please direct me to
some good tutorials that will explain it more succinctly.

Thank you.


JLGWhiz

trying my first user form.....
 
Look he

http://www.contextures.com/xlUserForm01.html

"SteveDB1" wrote:

Hi all.
After tinkering for a long while with macros-- mostly with help from many of
you-- I've decided to try my hand at user forms.
Some of the macros I have have multiple input boxes, and I'd like to reduce
the amount of them, and have all the input on a single form.
I've made the forms using the drag/drop toolbox, and now have to figure out
what's next?
I've found where I can change the names of the components in the property
box, and that will allow me to "link" the variable names I've given to my
macro elements. myRng_n, myCell_n, etc...... where _n is the number/letter
I've assigned to the given variable.

But after that.... I'm lost. And yes, I'll admit part of this is somewhat
intimidating, but since I've come this far, I have found I'm willing to let
go of that, and move forward......

My questions are-- trying not to be too general, yet general enough to get
the info I need-- what do I do next?

1- do I place the code elements for my variables within the sub for each
inputbox (of the same name) of the form? I.e., how do I link the macro input
demands to the form inputs?

2- how do I activate/cancel the form? From what I've tried thus far, it
seems that I need to place the entire sub (for my macro) within the
cmd_click_ok sub. Is there some basic code that activates the macro with that
button? Similarly, is there some code that cancels when I click cancel?

3- ultimately, my goal will be to take some old C++ code that I've written,
and make a windows program out of it using forms, etc.... (I took a C++ class
7-1/2 years ago, and we got to the very beginning of functions/classes. On my
own, I began tinkering with forms, but never got far enough to understand
what I was doing, and have found that it's now limiting my abilities in
programming, and moving forward.).

If this is going to be too complicated to explain here, please direct me to
some good tutorials that will explain it more succinctly.

Thank you.


ryguy7272

trying my first user form.....
 
Take a look at this:
http://www.mrexcel.com/tip009.shtml

This is good too:
http://www.fontstuff.com/greenwich/f...sUserForms.pdf


I remember when I first started learning about UserForms. They are kind of
difficult to deal with (well, at least that's how I felt), and somewhat
complex too. However, with complexity comes power. You can do many, many,
many things with UserForms that you can't do without them. So, spend some
time getting to know the ins and outs of the UserForm and a whole new world
of possibilites will open up for you.

Regards,
Ryan----

--
RyGuy


"JLGWhiz" wrote:

Look he

http://www.contextures.com/xlUserForm01.html

"SteveDB1" wrote:

Hi all.
After tinkering for a long while with macros-- mostly with help from many of
you-- I've decided to try my hand at user forms.
Some of the macros I have have multiple input boxes, and I'd like to reduce
the amount of them, and have all the input on a single form.
I've made the forms using the drag/drop toolbox, and now have to figure out
what's next?
I've found where I can change the names of the components in the property
box, and that will allow me to "link" the variable names I've given to my
macro elements. myRng_n, myCell_n, etc...... where _n is the number/letter
I've assigned to the given variable.

But after that.... I'm lost. And yes, I'll admit part of this is somewhat
intimidating, but since I've come this far, I have found I'm willing to let
go of that, and move forward......

My questions are-- trying not to be too general, yet general enough to get
the info I need-- what do I do next?

1- do I place the code elements for my variables within the sub for each
inputbox (of the same name) of the form? I.e., how do I link the macro input
demands to the form inputs?

2- how do I activate/cancel the form? From what I've tried thus far, it
seems that I need to place the entire sub (for my macro) within the
cmd_click_ok sub. Is there some basic code that activates the macro with that
button? Similarly, is there some code that cancels when I click cancel?

3- ultimately, my goal will be to take some old C++ code that I've written,
and make a windows program out of it using forms, etc.... (I took a C++ class
7-1/2 years ago, and we got to the very beginning of functions/classes. On my
own, I began tinkering with forms, but never got far enough to understand
what I was doing, and have found that it's now limiting my abilities in
programming, and moving forward.).

If this is going to be too complicated to explain here, please direct me to
some good tutorials that will explain it more succinctly.

Thank you.



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

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