Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default From CellA1 to a column of Date

Hi all experts, this is probably a very simple question but I am just stuck
here.

A1 is a Date, how can I read from A1 and write a column in another worksheet
of the date from first day to last day of the month and year of A1?

Many thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default From CellA1 to a column of Date

=IF(MONTH($A$1)=MONTH(DATE(YEAR($A$1),
MONTH($A$1),ROW(A1))),DATE(YEAR($A$1),MONTH($A$1), ROW(A1)),"")

Copy down to 31 rows

--
Kind regards,

Niek Otten

"Toto Sanderson" <Toto wrote in message
...
Hi all experts, this is probably a very simple question but I am just
stuck
here.

A1 is a Date, how can I read from A1 and write a column in another
worksheet
of the date from first day to last day of the month and year of A1?

Many thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default From CellA1 to a column of Date

Thanks for your quick response. But it doesn't work on my case.

Say,

m = Month(Worksheets("Sheet1").Cells(1, 1))
y = Year(Worksheets("Sheet1").Cells(1, 1))

in Sheet 2, how can I make the value of Cell B1 as the Date 01 to 30/31 of
month m and year y?

The following code doesn't work:
Worksheets("Sheet2").Cells(1, 2) = DATE(y, m, 1)

Please help again! Thanks!

"Niek Otten" wrote:

=IF(MONTH($A$1)=MONTH(DATE(YEAR($A$1),
MONTH($A$1),ROW(A1))),DATE(YEAR($A$1),MONTH($A$1), ROW(A1)),"")

Copy down to 31 rows

--
Kind regards,

Niek Otten

"Toto Sanderson" <Toto wrote in message
...
Hi all experts, this is probably a very simple question but I am just
stuck
here.

A1 is a Date, how can I read from A1 and write a column in another
worksheet
of the date from first day to last day of the month and year of A1?

Many thanks in advance!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default From CellA1 to a column of Date

<The following code doesn't work:
Worksheets("Sheet2").Cells(1, 2) = DATE(y, m, 1)

Use DateSerial instead

--
Kind regards,

Niek Otten


"Toto Sanderson" wrote in message
...
Thanks for your quick response. But it doesn't work on my case.

Say,

m = Month(Worksheets("Sheet1").Cells(1, 1))
y = Year(Worksheets("Sheet1").Cells(1, 1))

in Sheet 2, how can I make the value of Cell B1 as the Date 01 to 30/31 of
month m and year y?

The following code doesn't work:
Worksheets("Sheet2").Cells(1, 2) = DATE(y, m, 1)

Please help again! Thanks!

"Niek Otten" wrote:

=IF(MONTH($A$1)=MONTH(DATE(YEAR($A$1),
MONTH($A$1),ROW(A1))),DATE(YEAR($A$1),MONTH($A$1), ROW(A1)),"")

Copy down to 31 rows

--
Kind regards,

Niek Otten

"Toto Sanderson" <Toto wrote in
message
...
Hi all experts, this is probably a very simple question but I am just
stuck
here.

A1 is a Date, how can I read from A1 and write a column in another
worksheet
of the date from first day to last day of the month and year of A1?

Many thanks in advance!






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
Count Unique Values in 1 Column based on Date Range in another Column Brian Excel Worksheet Functions 14 May 17th 09 02:58 PM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Need the formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
Need Formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
If data in one column, take date, add 2 days, and turn the entire column a color... [email protected] Excel Discussion (Misc queries) 6 August 24th 06 03:58 AM


All times are GMT +1. The time now is 06:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"