View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Michael Vaughan Michael Vaughan is offline
external usenet poster
 
Posts: 71
Default Qn: How to show a date and time with a ' in it???

Hello Everyone,

I am trying to setup a page so that I can import a excel file to my
Microsoft Outlook Calendar. I can do it manually, but I am trying to write
a routine that will format the page for me. The problem is the time and
date. I have a routine that Tom Olgivy wrote for me:

Dim cell As Range
For Each cell In Range("A1:F10")
cell.Value = "'" & cell.Value
Next

It works for everything except the date and time. The problem is, when it
see's the time with a ', it treats it as TEXT. Now, if I manually put in a
' before the time in the formula bar, it will take it??? Then the time can
be imported correctly. But, how can I input that little tick ' in a routine
to do it automatically without it recognizing it as text???

Thanks.. mv