Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default formatting ques...

I want Excel to store an actual time (like "8:00") taken
from a cell in my worksheet rather than the decimal
equivalent (like .025) excel uses to represent time. Is
there a function to convert this? currently I have
declared the variable as a string.

Also, I cannot get excel to format my user defined data
type so it has a number format of "ddd" (which is the name
of the day, like mon, tue, etc..) My code is as follows:

Dim DateCell As Range
Set DateCell = Worksheets(1).Cells(row, 5)
DateCell.NumberFormat = "ddd"
Switching(i).DayofWeek = DateCell

where switching is my user defined data type and DayofWeek
is declared as a string. the data in Worksheets(1).Cells
(row,5) is a date and formatted like "11/15/2003"

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default formatting ques...

Dim DateCell As Range
Set DateCell = Worksheets(1).Cells(row, 5)
DateCell.NumberFormat = "ddd"
Switching(i).DayofWeek = DateCell.Text
or
Switching(i).DayofWeek = format(DateCell.Value2,"ddd")


Dim sTime as String
sTime = Format(now(),"hh:mm")

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
I want Excel to store an actual time (like "8:00") taken
from a cell in my worksheet rather than the decimal
equivalent (like .025) excel uses to represent time. Is
there a function to convert this? currently I have
declared the variable as a string.

Also, I cannot get excel to format my user defined data
type so it has a number format of "ddd" (which is the name
of the day, like mon, tue, etc..) My code is as follows:

Dim DateCell As Range
Set DateCell = Worksheets(1).Cells(row, 5)
DateCell.NumberFormat = "ddd"
Switching(i).DayofWeek = DateCell

where switching is my user defined data type and DayofWeek
is declared as a string. the data in Worksheets(1).Cells
(row,5) is a date and formatted like "11/15/2003"

thanks



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
IF formula ques Diane Excel Discussion (Misc queries) 2 December 23rd 08 05:48 PM
Follow up ques on using Listings ZIPPOMA NEEDS HELP Excel Discussion (Misc queries) 3 October 15th 08 02:32 AM
Ques. about LINK in my workbook CMIConnie Excel Discussion (Misc queries) 4 February 10th 06 03:54 PM
MACRO QUES FOR MVP Frantic Excel-er Excel Discussion (Misc queries) 2 May 27th 05 12:37 AM
ques maya Excel Worksheet Functions 1 March 5th 05 02:49 PM


All times are GMT +1. The time now is 07:46 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"