Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF formula ques | Excel Discussion (Misc queries) | |||
Follow up ques on using Listings | Excel Discussion (Misc queries) | |||
Ques. about LINK in my workbook | Excel Discussion (Misc queries) | |||
MACRO QUES FOR MVP | Excel Discussion (Misc queries) | |||
ques | Excel Worksheet Functions |