![]() |
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 |
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 |
All times are GMT +1. The time now is 01:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com