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 7th, 2002, 09:54 PM   #1
tvanharen
New Member
 
Join Date: Apr 2002
Posts: 6
Default

I am currently making a sheet that requires only one input from the user per row, with the rest of the cells in that row automatically filled in when the user enters the input in this specific cell in each row. Otherwise, the cells are blank. I've achieved this for most of the cells I want to do this for, except for cells that record the day, month, date, and time of the user's input into this one specific cell per row. I originally thought the NOW() function would be perfect, and in my original implementation, I thought it did work. The problem is this: the next day when I entered a new input in the input cell, the previous cells that used the NOW() function all updated with the current time, date, month, day, year, etc instead of keeping the original data from when the user input was originally made. Below is the formula I used to display the day of the week of the user's input. Any help with maybe getting the cells to freeze after input or converting the cells to their values and ignoring the formula after input would be much appreciated. It's not essential, but I would like to have this functionality in it. OK, here's the formula:

=IF(NOT(ISBLANK(E58)),CHOOSE(WEEKDAY(NOW()),"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"),"")

Essentially the formula works like this: the user input cell in this case is cell E58. If this cell is blank, then nothing appears in it. If the cell has been issued an input value, the CHOOSE() function gets an index value from WEEKDAY(NOW()) and finds the corresponding day of the week and returns it. Again, the problem is getting the cell to retain its value instead of constantly updating when more input is done elsewhere in the sheet. Thank you to all who consider my problem and devote time to it.

tvanharen is offline   Reply With Quote
Old Apr 7th, 2002, 10:12 PM   #2
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

I am looking for a resolution for getting the data entry date to be *hard data*....

As for your second question, you need only put, for instance, =E58 and then format the cell (not E58, but the destination cell) as Format-Cells, Custom, dddd
That is...unless I misunderstood your second question.

_________________
TheWordExpert

[ This Message was edited by: Dreamboat on 2002-04-07 21:13 ]
Anne Troy is offline   Reply With Quote
Old Apr 7th, 2002, 10:20 PM   #3
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Hi,

1. After the data is filled in, choose
Edit>Copy
Edit>Paste Special (values) in the cell

2. Suggested route:
Use a worksheet change event.

I am assuming that the column with your formula is column F.

1. Right click on the sheet tab and choose View Code

2. Copy the following and paste into the module.

----------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 And Len(Target) > 0 Then Target.Offset(0, 1) = Format(Date, "dddd")
If Len(Target) = 0 Then Target.Offset(0, 1) = ""
End Sub
----------------

Make sure you adjust to fit to your data.

I also added a check to see if a cell is cleared, the day column is also cleared. Please remove if not needed.

HTH,
Jay

Quote:
On 2002-04-07 20:54, tvanharen wrote:
I am currently making a sheet that requires only one input from the user per row, with the rest of the cells in that row automatically filled in when the user enters the input in this specific cell in each row. Otherwise, the cells are blank. I've achieved this for most of the cells I want to do this for, except for cells that record the day, month, date, and time of the user's input into this one specific cell per row. I originally thought the NOW() function would be perfect, and in my original implementation, I thought it did work. The problem is this: the next day when I entered a new input in the input cell, the previous cells that used the NOW() function all updated with the current time, date, month, day, year, etc instead of keeping the original data from when the user input was originally made. Below is the formula I used to display the day of the week of the user's input. Any help with maybe getting the cells to freeze after input or converting the cells to their values and ignoring the formula after input would be much appreciated. It's not essential, but I would like to have this functionality in it. OK, here's the formula:

=IF(NOT(ISBLANK(E58)),CHOOSE(WEEKDAY(NOW()),"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"),"")

Essentially the formula works like this: the user input cell in this case is cell E58. If this cell is blank, then nothing appears in it. If the cell has been issued an input value, the CHOOSE() function gets an index value from WEEKDAY(NOW()) and finds the corresponding day of the week and returns it. Again, the problem is getting the cell to retain its value instead of constantly updating when more input is done elsewhere in the sheet. Thank you to all who consider my problem and devote time to it.

Jay Petrulis is offline   Reply With Quote
Old Apr 7th, 2002, 10:34 PM   #4
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

I've seen this question a lot. Jay, I hope you don't mind if I store this one away.



(2 minutes later)
Jay, is there any way to make it just put in the date and time now if, for instance you put a value into column A, and you want the date/time to auto-appear in column B (same row of course). In other words, without using the =NOW() in any cell?

_________________
TheWordExpert

[ This Message was edited by: Dreamboat on 2002-04-07 21:39 ]
Anne Troy is offline   Reply With Quote
Old Apr 7th, 2002, 11:14 PM   #5
tvanharen
New Member
 
Join Date: Apr 2002
Posts: 6
Default

Thanks guys...I'll give those a try.
tvanharen is offline   Reply With Quote
Old Apr 8th, 2002, 12:09 AM   #6
tvanharen
New Member
 
Join Date: Apr 2002
Posts: 6
Default

Jay, the worksheet change event works great so far. I'll let you know if I can apply this effectively for the other elements that need it. Thanks for your help!
tvanharen is offline   Reply With Quote
Old Apr 8th, 2002, 01:02 AM   #7
tvanharen
New Member
 
Join Date: Apr 2002
Posts: 6
Default

Ok, I keep getting a type mismatch error...guess I'll keep trying...
tvanharen is offline   Reply With Quote
Old Apr 8th, 2002, 06:20 AM   #8
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-04-07 21:34, Dreamboat wrote:
I've seen this question a lot. Jay, I hope you don't mind if I store this one away.



(2 minutes later)
Jay, is there any way to make it just put in the date and time now if, for instance you put a value into column A, and you want the date/time to auto-appear in column B (same row of course). In other words, without using the =NOW() in any cell?

_________________
TheWordExpert

[ This Message was edited by: Dreamboat on 2002-04-07 21:39 ]
Hi Dreamboat,

You can use the VBA Now function to do what you wish.

Also, an interesting modification can be to put the date and time in a comment:

As before, but slightly modified:
-------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Len(Target) > 0 Then
Cells(Target.Row, "B") = Now
Cells(Target.Row, "B").AddComment (Format(Now, "m/d/yy h:mm"))
End If
If Len(Target) = 0 Then Target.Offset(0, 1) = ""
End Sub
-------------------------

Bye,
Jay
Jay Petrulis is offline   Reply With Quote
Old Apr 8th, 2002, 06:24 AM   #9
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-04-08 00:02, tvanharen wrote:
Ok, I keep getting a type mismatch error...guess I'll keep trying...
Hi,

Post more details so that we can eliminate your problem. This shouldn't be difficult to figure out.

Bye,
Jay
Jay Petrulis is offline   Reply With Quote
Old Apr 8th, 2002, 06:29 AM   #10
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Thanks, Jay!
__________________
~Anne Troy
Anne Troy 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:49 AM.


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