Mr. Lenning - I read your article with great interest and was able to set up a macro in my tool bar. However, I can not get the macro to do everything I want. I was trying to set up a current date in one cell and the current time in the next cell using the NOW() function. The movements that involved the mouse do not seem to work.
I was a long time lotus user and knew the key strokes for almost all commands. However, in Excel, I have become quite dependent on the mouse. I tired using the Alt key, but I can't seem to get the next function to work. For example, Alt O gets the format menu to show, but I cannot get the format cells function to work. Any help you can provide would be greatly appreciated.
Mary S
Mary, I am glad you enjoyed
Mary, I am glad you enjoyed the article. As you know, both cells must contain the =now() function. One of the cells you format as a Date (say cell B1), and the other cell you format as a Time (say C1).
If you are trying to "record" the macro, and the formatting does not line up with the cells that contain the functions, you will need to edit the macro directly as follows, by going to Tools -> Macros -> Visual basic editor.
1) Date cell. Use the following macro code to format row 1, column 2 as a date: Cells(1, 2).NumberFormat = "m/d/yy"
2) Time cell. Use the following macro code to format row 1, column 3 as a time: Cells(1, 3).NumberFormat = "h:mm AM/PM"
Note you can change the row and column numbers as necessary
Hope that helps,
Thanks,
Jeff
Jeff - Thanks for responding
Jeff - Thanks for responding so quickly. The thing I am having trouble with is how I record the move from one cell to the cell right next to it. In Lotus, you would type {right}. I can't find it in Help or the reference manual I have for how this is typed in Excel. Do you know?
Mary
Mary, Easy. Just enter the
Mary,
Easy. Just enter the following command in your macro, which tells Excel to move the active cell.
ActiveCell.Offset(0, 1).Activate
The Offset() function takes two function arguments. The first function argument tells how many rows up or down to move (positive numbers move down, negative numbers move up, 0 stays on the current row). The second function argument tells how many columns left or right to move (positive numbers move right, negative numbers move left, 0 stays on the current column).
Hope that helps!
Thanks,
Jeff
Got it...thanks jeff!
Got it...thanks jeff!