PDA

View Full Version : Worksheet entry help



revzephyr
07-13-2013, 02:45 AM
Hi everyone,

first of all, thanks to those who tries to help me with the followings.

I am totally new to macro/vba.
What I trying to do is to create an entry form, and the filled information will be recorded in another sheet within the same book.
I have attached the general image of how the form needs to have.

I know I am pretty much asking from zero, but I really need your help.

Thank you very much!!

patel
07-13-2013, 02:52 AM
http://www.contextures.com/xlUserForm01.html

revzephyr
07-13-2013, 03:57 AM
Patel

Thanks for the reply.
I know that there is a userform in VBA.
what I am trying to do is create a form IN the worksheet, so there is no need for a pop up window

SamT
07-13-2013, 08:26 AM
First I suggest that you design a new Data Entry form using the Controls Toolbox menu instead of the Forms menu. Counter intuitively, the Controls Toolbox uses the new Microsoft Forms objects, but the "Forms" Menu uses very old Excel 95 objects.

It will give you much more control of the objects you use and is much easier to code for.

Do not use any sheet cells in the form, instead use Labels and TextBoxes.

I also suggest that your fist repost to this thread use a very simplified example of your form, for example, the Name Label, the Name TextBox and the Add Data button, and, of course, with the Record Sheet. As we get each control's code working, ask about the next one. Leave the Picture control for last, after you have some knowledge of coding since it will be the most difficult to understand.

As you add controls to the form, give them a meaningful Caption, (ie; "Add Data",) and a name that reflects the Caption, ie; "cbutAddData." Note that spaces are not allowed in control names. Since labels will not be used in your form's code, you should leave them their default names, ("Label1", etc.)

Common Control Name prefixes and their uses:

frm: UserForms
tbx: TextBoxes
cbu, cbut: CommandButtons
cbo, cbx: ComboBox
fra: Frames
lst, lbx, : ListBoxes
chk, chx, chbx: Checkboxes
opt, obut,: OptionButton
img, ibx, ibox: Image Control
Underscore, "_": Replaces spaces, " " in Names

"prefix_Namepart_Namepart"



In the Controls ToolBox menu you'll find a "More Controls" button. This will give you access to the Microsoft Forms Frame control. Place any mutually exclusive CheckBoxes on a Frame. You don't have to rename Frames since the code won't act on them.

The easy way to get to the helps on the controls is to right click any control, select "Properties," place the mouse in any of the Right hand list items and press F1. This will Open the Help program to "Microsoft Forms Microsoft Forms Object Model Overview." In the Left pane, click the "+" button, next to "Microsoft Forms Object Model Reference," then the "+" next to "Objects, Collection, And Controls."

Basically, for any Control. "Events" are Macro triggers, "Methods" do things to the control, and "Properties" return or set control values.

Hope to see you back soon