Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dar Dar is offline
external usenet poster
 
Posts: 25
Default Time format and various users

I may be going at this the wrong way; However, I have a spreadsheet that has
two columns labeled "Time" and "AM/PM". I need the AM/PM for which Access
uses to sort report from. ( I import excel into Access)
The problem is various users input into excel and don't always place the
AM/PM into appropriate cell which causes errors upon import.
I would like to create macro which will fill in am/pm if there is a time
listed in the
"Time" column.
Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Time format and various users

Use a formula

-IF(A2<.5,"AM","PM")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"dar" wrote in message
...
I may be going at this the wrong way; However, I have a spreadsheet that

has
two columns labeled "Time" and "AM/PM". I need the AM/PM for which

Access
uses to sort report from. ( I import excel into Access)
The problem is various users input into excel and don't always place the
AM/PM into appropriate cell which causes errors upon import.
I would like to create macro which will fill in am/pm if there is a time
listed in the
"Time" column.
Any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Time format and various users

for each cell in Range("B1",Range("B1").End(xldown))
if isdate(cell) then
if hour(cell) < 12 then
cell.offset(0,1).Value = "AM"
else
cell.offset(0,1).Value = "PM"
end if
end if
Next

However, if people put in 10:00 in the time cell and PM in the AM/PM cell,
then the code would replace it with AM. If you are working on an 8 to 5
type schedule and the times are all between 8:00 and 5:00 rather than
military times, then


for each cell in Range("B1",Range("B1").End(xldown))
if isdate(cell) then
if hour(cell) <= 12 then
cell.offset(0,1).Value = "PM"
else
cell.offset(0,1).Value = "AM"
end if
end if
Next



--
Regards,
Tom Ogilvy


"dar" wrote in message
...
I may be going at this the wrong way; However, I have a spreadsheet that

has
two columns labeled "Time" and "AM/PM". I need the AM/PM for which

Access
uses to sort report from. ( I import excel into Access)
The problem is various users input into excel and don't always place the
AM/PM into appropriate cell which causes errors upon import.
I would like to create macro which will fill in am/pm if there is a time
listed in the
"Time" column.
Any help would be appreciated.



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
Multiple users edit same spreadsheet at same time? ufcadmin Excel Discussion (Misc queries) 1 September 14th 07 05:24 PM
Multiple users of spreadsheet at same time Dirk_Bob Excel Discussion (Misc queries) 2 June 19th 07 01:44 AM
Making changes to the same worksheet by two users at the same time Monika Graczyk Excel Discussion (Misc queries) 1 May 17th 06 10:40 AM
Excel workbook to be used by multiple users at same time....possible??? malik641 Excel Worksheet Functions 1 June 26th 05 01:45 AM
Users suddenly able to modify the same documents at the same time. TxVics Excel Discussion (Misc queries) 0 May 18th 05 09:43 PM


All times are GMT +1. The time now is 07:55 AM.

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

About Us

"It's about Microsoft Excel"