MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 23rd, 2002, 10:30 PM   #1
Samanathon
New Member
 
Samanathon's Avatar
 
Join Date: Apr 2002
Posts: 12
Default

Okey, here is the deal:

I have made a Userform that includes 3 text boxes that a user would input info into (the userform has "OK" & "Cancel" buttons as well).

When the "OK" button is clicked, the code will insert a new row (lets say row A) and input the info from the text boxes in the cells (A1, A2, A3).

What command would I use to take the info (that that the user inputted into the text boxes) and place them into the new A1, A2 & A3 cells?

------------------------

I have programed the Userform to insert that new row as soon as the button that activates the userform is press, but I don't think that I would like keep it like this - because the cancel button doesn't undo the insert . . .

-Thanks!!!
Samanathon
Samanathon is offline   Reply With Quote
Old Apr 23rd, 2002, 11:00 PM   #2
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Something like this...

Sheet1.Range("A1") = TextBox1.Text

Tom
Tom Schreiner is offline   Reply With Quote
Old Apr 24th, 2002, 07:19 AM   #3
Samanathon
New Member
 
Samanathon's Avatar
 
Join Date: Apr 2002
Posts: 12
Default

Thanks for the reply Tom!

I am still having a bit of trouble with this text box . . .

I tried "Sheet1.Range("A1") = TextBox1.Text" but still couldn't get it to work

-------------------------------

Some more info:

1. User clicks a button that activates a user form

2. Userform has three text boxes

3. After entering info, user clicks "OK"

4. Info is inputted into cells

5. Userform hides

----------------------------------

^^ I am having trouble with #4 of this example.

Thanks for all of your help!
Samanathon is offline   Reply With Quote
Old Apr 24th, 2002, 07:43 AM   #4
Audiojoe
Board Regular
 
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
Default

Try this:

worksheets("sheet1").range("a1").value=textbox1

Audiojoe
Audiojoe is offline   Reply With Quote
Old Apr 24th, 2002, 02:29 PM   #5
dhoffman
New Member
 
Join Date: Apr 2002
Location: Lawrence, KS
Posts: 29
Default

Quote:
On 2002-04-23 21:30, Samanathon wrote:

When the "OK" button is clicked, the code will insert a new row (lets say row A) and input the info from the text boxes in the cells (A1, A2, A3).

I have programed the Userform to insert that new row as soon as the button that activates the userform is press, but I don't think that I would like keep it like this - because the cancel button doesn't undo the insert . . .
Ok, I am a little confused here, when exactly are you inserting the new row? Because you should insert it after the OK button on the User Form is clicked. You should not insert the new row as soon as the User Form is activated. That way the cancel button doesn't have to undo anything because nothing is done until OK is clicked.
dhoffman is offline   Reply With Quote
Old Apr 24th, 2002, 08:50 PM   #6
Samanathon
New Member
 
Samanathon's Avatar
 
Join Date: Apr 2002
Posts: 12
Default

^^ I know, that's just how I have it right now - I've never really played around with Userforms until now. I will change it though.

-Thanks!
Samanathon is offline   Reply With Quote
Old Apr 24th, 2002, 11:33 PM   #7
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

What is the current code that you are using
with the cmd button.
What is the sheet name you are tarnsfering
to.


__________________
Kind Regards,
Ivan F Moala From the City of Sails
Ivan F Moala is offline   Reply With Quote
Old Apr 25th, 2002, 02:38 PM   #8
Samanathon
New Member
 
Samanathon's Avatar
 
Join Date: Apr 2002
Posts: 12
Default

The sheet name is the defult "Sheet 1", and here is the current code:






Private Sub Cancel_Click()
Message = "Do you really want to back out " _
& "be a wimp?"
'This will ask the user to confirm that they
' wish to close the Userform.
If MsgBox(Message, vbYesNo) = vbYes Then
Hide
'If they click "Yes", then it will close!
End If
'If they click "No", the comfirmation box closes.
End Sub
-------------------------------------------
Private Sub Input_Date_Change()

End Sub
-------------------------------------------
Private Sub Input_DRO_Number_Change()

End Sub
-------------------------------------------
Private Sub Input_Show_Name_Change()

End Sub
-------------------------------------------
Private Sub Input_Show_Click()
' Insert_A_Row_A6 Macro
' Macro recorded 4/23/2002 by Saman Sadeghi
' Rows("6:6").Select
Selection.Insert Shift:=xlDown
'This will insert a new row at cell A6
End Sub
Samanathon is offline   Reply With Quote
Old Apr 26th, 2002, 02:25 PM   #9
Samanathon
New Member
 
Samanathon's Avatar
 
Join Date: Apr 2002
Posts: 12
Default

Anyone?
Samanathon is offline   Reply With Quote
Old Apr 26th, 2002, 03:24 PM   #10
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

Lemme see, try to break it down to the nitty gritty. Go into the Visual basic editor. Go into your userform module (not a normal module, in the project expolorer, this module is located in the "forms" folder, expand the contents of this folder), it's probably "userform1", you can browse modules with the project explorer. Figure out the name of your "OK" button and the name of your "Textbox", you can find out/verify by right-clicking on these items in the vbe and select properties. Right click on your form and place the following:

Code:
Private Sub CommandButton1_Click()
Sheet1.[a1] = TextBox1.Text
End Sub
Change CommandButton1 to the name of your "Ok" button and change TextBox1 to the name of your textbox. Hope this helps.

_________________
Cheers, NateO

[ This Message was edited by: NateO on 2002-04-26 15:26 ]
NateO is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:33 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes