![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 31
|
I am a home user of Excel 2000 and I am trying to do a daily log sheet for my thoughts and stuff in an Excel woorkbook. With hot keys or a button, how can I enter the date and time into the first 2 cells ( A + B ) and the cursor ending up in the third cell ( C ) of the first empty row in the active sheet. I may do this 7 or 8 times a day and if I use =Today(), won't the date always be todays date?? Thank you for your time and help. John
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,383
|
Try this macro, which you can assign to a button or a keyboard shortcut.
Sub NowAndC() Range("A65536").End(xlUp).Offset(1, 0).Activate Range(ActiveCell, ActiveCell.Offset(0, 1)).Value = Now ActiveCell.Offset(0, 2).Select End Sub |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi John:
Welcome to the board. John, from your statement that you are a home user, I get the impression that you are getting interested in advancing your knowledge of Excel. T put the date in two cells, say A1 and B1, you may want to merge the cells. Later on you may find that perhaps it is not necessary to use up two cells to enter the date. Yes, with =TODAY() and =NOW(), the date (time) will always be current. If you wanted to key-in the date for the purpose of date-stamping your entry, you can use CTRL+; to enter the date -- date entered this way will remain static. And lastly, after you have entered the date in cell A1, use the right arrow key twice to reach cell C1. You can always click in any cell with your mouse to make that cell the active cell. And then there is of course the wonderful wonderful world of VBA to accomplish more things. I Hope This Helps Regards! _________________ Yogi Anand Edit: Deleted inactive web site reference from hard code signature line [ This Message was edited by: Yogi Anand on 2003-01-19 16:24 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Posts: 31
|
Thank you for the welcome and the macro worked perfectly. Thank you all!
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
|
Hope this helps. JSW
Sub myLog() Dim myDate As Date Dim myTime 'Joe Was, 5/2002. 'Note: Add this code to a Sheet module, right-click sheet-tab, select View-Code 'and paste this code. 'With Tools-Macro-macros, select this sub, select Options, assign hot-key. 'Select "n" so, Ctrl+n runs this code. 'Each column "A, B & C" should have a lable. 'Note: Data starts directly below labels. 'Store date & time for each new post. myDate = Date myTime = Time 'Select next blank row & add data. 'Note: Change sheet-name if needed! Worksheets("Sheet1").Range(Range("A65535"), Range("A54535").End(xlUp)).Select ActiveCell.Offset(1, 0) = myDate Worksheets("Sheet1").Range(Range("B65535"), Range("B65535").End(xlUp)).Select ActiveCell.Offset(1, 0) = myTime 'Move right and select for note. ActiveCell.Offset(1, 1).Select End Sub [ This Message was edited by: Joe Was on 2002-05-17 21:37 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|