Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
add numbers in textboxes on userform
Hi!
I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform. I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the sum (total) in Textbox5. I've tried the following code attached to a command button: me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4) I keep getting the error message that textbox4 member or data cannot be found. I've double check the spelling of the names and they are correct. If I remove Textbox4 from the code, then the error states it cannot find textbox3 member or data. What am I doing wrong?? Thanks in advance for your help!!! Kimberly |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
add numbers in textboxes on userform
Kimberly,
What's in the textboxes is a string. You have to convert them to numbers before adding them. e.g. me.textbox5= cDbl(textbox1) + cDbl(textbox2) etc. John KimberlyC wrote: Hi! I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform. I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the sum (total) in Textbox5. I've tried the following code attached to a command button: me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4) I keep getting the error message that textbox4 member or data cannot be found. I've double check the spelling of the names and they are correct. If I remove Textbox4 from the code, then the error states it cannot find textbox3 member or data. What am I doing wrong?? Thanks in advance for your help!!! Kimberly |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
add numbers in textboxes on userform
Hi
Thanks! I tried it and I'm still getting the same error messages. Is there anything else that could casue these errors? Thanks again!! "John Wilson" wrote in message ... Kimberly, What's in the textboxes is a string. You have to convert them to numbers before adding them. e.g. me.textbox5= cDbl(textbox1) + cDbl(textbox2) etc. John KimberlyC wrote: Hi! I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform. I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the sum (total) in Textbox5. I've tried the following code attached to a command button: me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4) I keep getting the error message that textbox4 member or data cannot be found. I've double check the spelling of the names and they are correct. If I remove Textbox4 from the code, then the error states it cannot find textbox3 member or data. What am I doing wrong?? Thanks in advance for your help!!! Kimberly |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
add numbers in textboxes on userform
Kimberly,
If the textboxes do exist, they should be listed in the dropdown in the VBA Editor. If they don't, try to compile the project and save, close, reopen the workbook. John "KimberlyC" wrote in message ... Hi Thanks! I tried it and I'm still getting the same error messages. Is there anything else that could casue these errors? Thanks again!! "John Wilson" wrote in message ... Kimberly, What's in the textboxes is a string. You have to convert them to numbers before adding them. e.g. me.textbox5= cDbl(textbox1) + cDbl(textbox2) etc. John KimberlyC wrote: Hi! I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform. I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the sum (total) in Textbox5. I've tried the following code attached to a command button: me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4) I keep getting the error message that textbox4 member or data cannot be found. I've double check the spelling of the names and they are correct. If I remove Textbox4 from the code, then the error states it cannot find textbox3 member or data. What am I doing wrong?? Thanks in advance for your help!!! Kimberly |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
add numbers in textboxes on userform
Thanks John
I just needed to close and reopen. It's working now. Thanks again! "John Wilson" wrote in message ... Kimberly, If the textboxes do exist, they should be listed in the dropdown in the VBA Editor. If they don't, try to compile the project and save, close, reopen the workbook. John "KimberlyC" wrote in message ... Hi Thanks! I tried it and I'm still getting the same error messages. Is there anything else that could casue these errors? Thanks again!! "John Wilson" wrote in message ... Kimberly, What's in the textboxes is a string. You have to convert them to numbers before adding them. e.g. me.textbox5= cDbl(textbox1) + cDbl(textbox2) etc. John KimberlyC wrote: Hi! I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform. I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the sum (total) in Textbox5. I've tried the following code attached to a command button: me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4) I keep getting the error message that textbox4 member or data cannot be found. I've double check the spelling of the names and they are correct. If I remove Textbox4 from the code, then the error states it cannot find textbox3 member or data. What am I doing wrong?? Thanks in advance for your help!!! Kimberly |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
add numbers in textboxes on userform
Kimberly,
I just needed to close and reopen. It's working now. I'm glad that solved your problem, but.......... When you add a textbox (or other control) to a UserForm it should "automatically" be included in your "project" without having to close and reopen. Sometimes this doesn't happen and I can't give you an answer as to why. I've asked why in the ng's and can't really get a definitive answer myself, but it does happen. Anyway.....since this did occur in the particular workbook that you're using, if you haven't already done so, do yourself a favor and dowload Rob Bovey's "Code Cleaner". http://www.appspro.com/ and use it religiously (at least on this workbook). John "KimberlyC" wrote in message ... Thanks John I just needed to close and reopen. It's working now. Thanks again! "John Wilson" wrote in message ... Kimberly, If the textboxes do exist, they should be listed in the dropdown in the VBA Editor. If they don't, try to compile the project and save, close, reopen the workbook. John "KimberlyC" wrote in message ... Hi Thanks! I tried it and I'm still getting the same error messages. Is there anything else that could casue these errors? Thanks again!! "John Wilson" wrote in message ... Kimberly, What's in the textboxes is a string. You have to convert them to numbers before adding them. e.g. me.textbox5= cDbl(textbox1) + cDbl(textbox2) etc. John KimberlyC wrote: Hi! I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform. I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the sum (total) in Textbox5. I've tried the following code attached to a command button: me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4) I keep getting the error message that textbox4 member or data cannot be found. I've double check the spelling of the names and they are correct. If I remove Textbox4 from the code, then the error states it cannot find textbox3 member or data. What am I doing wrong?? Thanks in advance for your help!!! Kimberly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm TextBoxes - Is there a way to format as currency or perce | Excel Discussion (Misc queries) | |||
Send and Receive Data From Web Site Into UserForm TextBoxes | Excel Discussion (Misc queries) | |||
Textboxes | Excel Discussion (Misc queries) | |||
Need help w/ userform with 12 textboxes with data going into colum | Excel Discussion (Misc queries) | |||
UserForm TextBoxes | Excel Discussion (Misc queries) |