Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
The following macro inputs the current date and time into one cell:
Sub DateAndTime() With ActiveCell .Value =3D Now .NumberFormat =3D "mm/dd/yy h:mm AM/PM" End With End Sub Since the information is input without using the "Enter" key, however, = my=20 Data Validation formatting doesn't respond to it. (I have the validation = set up=20 to flash a warning box if the time isn't between 9:00 AM and 5:00 PM.) = If I=20 click into the cell affter the macro is run and hit "Enter," the = validation kicks=20 in, but that kind of defeats the point of having validation at all. How do I rewrite the macro so that it hits "Enter," so to speak, after = it has=20 run? =20 Thanks and cheers! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
enter data on 1 sheet and make it enter on next avail row on 2nd s | Excel Discussion (Misc queries) | |||
Enabling macros | Excel Discussion (Misc queries) | |||
sorting with macros | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) | |||
The available macros list in XL; how to suppress filename from showing | Excel Discussion (Misc queries) |