View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Reference sheets named by DAY

On Tuesday, January 20, 2015 at 4:20:13 AM UTC-8, Claus Busch wrote:
Hi Howard,

Am Tue, 20 Jan 2015 04:12:33 -0800 (PST) schrieb L. Howard:

CStr Converts an expression to string data type


Sheets(20) is the 20th sheet in the workbook.
Sheets("20") is your sheet named by day.
Day(Date) is a numeric value and would refer to the 20th sheet.
So you have to convert Day(Date) to string.


Regards
Claus B.
--


Okay, thanks. Along with that and this that I found, should keep me off the streets for awhile!


CStr and Date

The Date type always contains both date and time information. For purposes of type conversion, Visual Basic considers 1/1/0001 (January 1 of the year 1) to be a neutral value for the date, and 00:00:00 (midnight) to be a neutral value for the time. CStr does not include neutral values in the resulting string. For example, if you convert #January 1, 0001 9:30:00# to a string, the result is "9:30:00 AM"; the date information is suppressed. However, the date information is still present in the original Date value and can be recovered with functions such as DatePart.

Howard