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 Mar 5th, 2002, 12:51 PM   #1
Guest
 
Posts: n/a
Default

I have made a data form for my excel invoice template it runs at the start up and when you enter the data into the form it transfers it to the cells I have specified, however I want the cells I have entered data to from my form specified as currency but when I highlight them and click currency so the next time it will be made currency I save the workbook and exit. I load the workbook up again and the data form pops up, I enter data into it and it is entered still as number I don't know what I'm doing please help!
  Reply With Quote
Old Mar 5th, 2002, 01:02 PM   #2
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

I need to know this please help anyone!
Arash_The_A_Level_Student is offline   Reply With Quote
Old Mar 5th, 2002, 01:15 PM   #3
Mudface
MrExcel MVP
 
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
Default

Maybe not quite what you need but it should get you started- the following will transfer what you've put into TextBox1 on your userform to cell A1 on the active worksheet and format it as currency, once you click the command button: -

Private Sub CommandButton1_Click()

If Not IsNumeric(TextBox1.Text) Then
TextBox1.Text = ""
MsgBox "Please enter a number"
TextBox1.SetFocus
Exit Sub
End If
ActiveSheet.Range("A1").Value = FormatCurrency(TextBox1.Text)

End Sub
Mudface is offline   Reply With Quote
Old Mar 5th, 2002, 01:16 PM   #4
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

I don't mean to soubnd rude but could you please elaborate on this? thanks Arash
Arash_The_A_Level_Student is offline   Reply With Quote
Old Mar 5th, 2002, 01:26 PM   #5
Mudface
MrExcel MVP
 
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
Default

Sorry, I was presuming you'd made a UserForm in the VBA editor. If you're just using an automatic form (from the Data-Form menu), then just type in your values as a number on the form. Select the column(s) where you want the data to appear, click on Format-Cells and select currency. Hope that's what you meant.
Mudface is offline   Reply With Quote
Old Mar 5th, 2002, 01:34 PM   #6
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

Yeah I made the user form in the VBA editor, I just don't know where to put the code
Arash_The_A_Level_Student is offline   Reply With Quote
Old Mar 5th, 2002, 01:41 PM   #7
Mudface
MrExcel MVP
 
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
Default

OK, start again .

Presumably, your form has one or more textboxes to enter your data into and a command button which, when clicked, transfers your data to the worksheet?

If so, enter the code above into the command button's click event (this is automatically generated when you double click on the command button in design mode). Modify the code if you have called your textbox something else.

If you're still having problems, please be more specific about what you've done, what's on your form and what you've called each control. Post your existing code too, as it's much easier to respond when you have all the info.
Mudface is offline   Reply With Quote
Old Mar 5th, 2002, 01:43 PM   #8
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

sorry I can't really get what I'm trying to say out here is my VBA code:

Private Sub cmdEnterD_Click()
Sheet1.Range("g18").Value = txtCollection
Unload Me
End Sub

Private Sub Label1_Click()

End Sub

Private Sub Label2_Click()

End Sub

Private Sub txtGrossW_Change()

End Sub

Private Sub UserForm_Click()

End Sub

Arash_The_A_Level_Student is offline   Reply With Quote
Old Mar 5th, 2002, 01:52 PM   #9
Mudface
MrExcel MVP
 
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
Default

Aha- amend your first sub to this: -

Private Sub cmdEnterD_Click()

If Not IsNumeric(txtCollection.Text) Then
txtCollection.Text = ""
MsgBox "Please enter a number"
txtCollection.SetFocus
Exit Sub
End If
ActiveSheet.Range("g18").Value = FormatCurrency(txtCollection.Text)
Unload Me

End Sub
Mudface is offline   Reply With Quote
Old Mar 5th, 2002, 02:02 PM   #10
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

Thanks alot I have a feeling this will help thank you for your time!
Arash_The_A_Level_Student 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 03:47 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