Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Data entry form macro shows wrong formats

My Excel 2007 table has columns containing dates in the format 2009-11-15 and
times in the format 14:16 ( [h]:mm ). I open a data entry form by clicking on
the form button in the Quick Access Toolbar. I insert the current date using
the keyboard shortcut Control-semicolon. The date appears in the expected
format.

I prefer to open the data entry form using the following macro, to which I
have assigned the keyboard shortcut Control-Shift-O:

Sub OpenDataForm()
' Keyboard Shortcut: Ctrl+Shift+O
ActiveSheet.ShowDataForm
End Sub

However, when I open the data entry form using the macro, the form does not
recognize the format setting in the Excel table, and displays dates in the
format 11/15/2009. Similarly, times appear in AM/PM format instead of my
24-hour format. When the form data is saved as a new entry, these unwanted
formats appear in the table.

(1) Why do the formats differ depending on whether the data entry form is
invoked by button-clicking or the macro?

(2) How should I rewrite the macro to ensure that it picks up format
settings from the Excel table?

Thanks.

David



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart Shows data wrong way around [email protected] Charts and Charting in Excel 5 January 15th 08 05:30 PM
Data Entry Form: Macro-One To Many [email protected] Excel Discussion (Misc queries) 10 April 20th 07 01:04 PM
Shared workbook shows wrong data justanormalguy Excel Programming 1 July 31st 06 04:35 AM
Can a standard data entry form be used to change formats of cells? BarryW Excel Discussion (Misc queries) 0 January 21st 06 03:06 PM
Data form Dates wrong when called from macro? brym Excel Programming 0 July 29th 03 07:08 PM


All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"