U
undrline via OfficeKB.com
Here is my (broken) attempt at using SendKeys, if you could please help me
fix:
Selection.NumberFormat = "m/d/yyyy"
' not enough if Windows Regional Settings and cell values are both mm/dd/yyyy
before starting, so SendKeys
SendKeys "%o", True ' Format
SendKeys "e", True ' Cells...
' have to hope that the "Numbers" tab is the one showing
SendKeys "{TAB}", True ' focus on datatype
SendKeys "c", True ' already in date format from previous line; only one
C needs to be pressed
SendKeys "{TAB}", True ' focus to textbox
SendKeys "m/d/yyyy", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True ' focus to OK
SendKeys "{ENTER}", True
fix:
Selection.NumberFormat = "m/d/yyyy"
' not enough if Windows Regional Settings and cell values are both mm/dd/yyyy
before starting, so SendKeys
SendKeys "%o", True ' Format
SendKeys "e", True ' Cells...
' have to hope that the "Numbers" tab is the one showing
SendKeys "{TAB}", True ' focus on datatype
SendKeys "c", True ' already in date format from previous line; only one
C needs to be pressed
SendKeys "{TAB}", True ' focus to textbox
SendKeys "m/d/yyyy", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True ' focus to OK
SendKeys "{ENTER}", True