#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Check month

Hi all,

How to set the entry in a specific column must in date type and checking for
this date must in a specific month? e.g. in the sheet name "Feb", all the
date in column in "A" other than February will not be accepted and prompt a
dialog box to ask the user to use another sheet..

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Check month

You could create data validation for the column, let's say column E for this
example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"jimmy" wrote in message ...
Hi all,

How to set the entry in a specific column must in date type and checking
for this date must in a specific month? e.g. in the sheet name "Feb", all
the date in column in "A" other than February will not be accepted and
prompt a dialog box to ask the user to use another sheet..

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Check month

Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips" .gbl...
You could create data validation for the column, let's say column E for
this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and checking
for this date must in a specific month? e.g. in the sheet name "Feb", all
the date in column in "A" other than February will not be accepted and
prompt a dialog box to ask the user to use another sheet..

Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Check month

Filename is an argument to the Cell worksheet function telling it to return
the fully qualified path and filename of the workbook (and the sheet name).
However, it returns nothing unless the workbook has been saved once (so it
has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message ...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips"
.gbl...
You could create data validation for the column, let's say column E for
this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and checking
for this date must in a specific month? e.g. in the sheet name "Feb",
all the date in column in "A" other than February will not be accepted
and prompt a dialog box to ask the user to use another sheet..

Thanks







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Check month

My excel file is in the d:Book1.xls, I type the following in the sheet3 cell
"E1", then E1 display 1900/1/0. How to use it to check for the cell in "A1"
is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy" bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and the
sheet name). However, it returns nothing unless the workbook has been
saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips" .gbl...
You could create data validation for the column, let's say column E for
this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the sheet name
"Feb", all the date in column in "A" other than February will not be
accepted and prompt a dialog box to ask the user to use another sheet..

Thanks











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Check month

First, the sheet must have a Month name, so change Sheet3 to Mar
Put this in cell E1 of the sheet named Mar (don't change the formula -
don't replace "filename")

=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

Now select Column A of the sheet named Mar

go to Data=Validation

Select Custom and in the textbox put in the formula

=Month(A1)=$E$1

and click OK.

--
Regards,
Tom Ogilvy

"jimmy" wrote in message ...
My excel file is in the d:Book1.xls, I type the following in the sheet3
cell "E1", then E1 display 1900/1/0. How to use it to check for the cell
in "A1" is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy"
bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and the
sheet name). However, it returns nothing unless the workbook has been
saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips"
.gbl...
You could create data validation for the column, let's say column E for
this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the sheet
name "Feb", all the date in column in "A" other than February will not
be accepted and prompt a dialog box to ask the user to use another
sheet..

Thanks











  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Check month

Thank you..
In fact, what's the different between using this and just set 01-03-2007 to
31-03-2007 in the Data = Validation?

"Tom Ogilvy" bl...
First, the sheet must have a Month name, so change Sheet3 to Mar
Put this in cell E1 of the sheet named Mar (don't change the formula -
don't replace "filename")

=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

Now select Column A of the sheet named Mar

go to Data=Validation

Select Custom and in the textbox put in the formula

=Month(A1)=$E$1

and click OK.

--
Regards,
Tom Ogilvy

"jimmy" wrote in message
...
My excel file is in the d:Book1.xls, I type the following in the sheet3
cell "E1", then E1 display 1900/1/0. How to use it to check for the cell
in "A1" is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy" bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and the
sheet name). However, it returns nothing unless the workbook has been
saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips" .gbl...
You could create data validation for the column, let's say column E
for this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the sheet
name "Feb", all the date in column in "A" other than February will
not be accepted and prompt a dialog box to ask the user to use
another sheet..

Thanks













  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Check month

This will vary the validation based upon the sheet name, so you can apply
the same formula to all sheets, not a different one to each.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"jimmy" wrote in message ...
Thank you..
In fact, what's the different between using this and just set 01-03-2007
to 31-03-2007 in the Data = Validation?

"Tom Ogilvy"
bl...
First, the sheet must have a Month name, so change Sheet3 to Mar
Put this in cell E1 of the sheet named Mar (don't change the formula -
don't replace "filename")

=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

Now select Column A of the sheet named Mar

go to Data=Validation

Select Custom and in the textbox put in the formula

=Month(A1)=$E$1

and click OK.

--
Regards,
Tom Ogilvy

"jimmy" wrote in message
...
My excel file is in the d:Book1.xls, I type the following in the sheet3
cell "E1", then E1 display 1900/1/0. How to use it to check for the
cell in "A1" is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy"
bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and the
sheet name). However, it returns nothing unless the workbook has been
saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips"
.gbl...
You could create data validation for the column, let's say column E
for this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the sheet
name "Feb", all the date in column in "A" other than February will
not be accepted and prompt a dialog box to ask the user to use
another sheet..

Thanks















  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Check month

ic..thank you.
The 12 sheets have named as January to December, I wish to write the code in
the Workbook open() function that the current month sheet activate...I tried
MONTH(TODAY()).ACTIVATE but failed. What the code should be?

"Bob Phillips" bl...
This will vary the validation based upon the sheet name, so you can apply
the same formula to all sheets, not a different one to each.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Thank you..
In fact, what's the different between using this and just set 01-03-2007
to 31-03-2007 in the Data = Validation?

"Tom Ogilvy" bl...
First, the sheet must have a Month name, so change Sheet3 to Mar
Put this in cell E1 of the sheet named Mar (don't change the formula -
don't replace "filename")

=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

Now select Column A of the sheet named Mar

go to Data=Validation

Select Custom and in the textbox put in the formula

=Month(A1)=$E$1

and click OK.

--
Regards,
Tom Ogilvy

"jimmy" wrote in message
...
My excel file is in the d:Book1.xls, I type the following in the sheet3
cell "E1", then E1 display 1900/1/0. How to use it to check for the
cell in "A1" is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy" bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and the
sheet name). However, it returns nothing unless the workbook has been
saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips" .gbl...
You could create data validation for the column, let's say column E
for this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in
my addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the sheet
name "Feb", all the date in column in "A" other than February will
not be accepted and prompt a dialog box to ask the user to use
another sheet..

Thanks

















  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Check month

Try

Worksheets(Format(Date,"mmmm")).Activate

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"jimmy" wrote in message ...
ic..thank you.
The 12 sheets have named as January to December, I wish to write the code
in the Workbook open() function that the current month sheet activate...I
tried MONTH(TODAY()).ACTIVATE but failed. What the code should be?

"Bob Phillips"
bl...
This will vary the validation based upon the sheet name, so you can apply
the same formula to all sheets, not a different one to each.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Thank you..
In fact, what's the different between using this and just set 01-03-2007
to 31-03-2007 in the Data = Validation?

"Tom Ogilvy"
bl...
First, the sheet must have a Month name, so change Sheet3 to Mar
Put this in cell E1 of the sheet named Mar (don't change the formula -
don't replace "filename")

=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

Now select Column A of the sheet named Mar

go to Data=Validation

Select Custom and in the textbox put in the formula

=Month(A1)=$E$1

and click OK.

--
Regards,
Tom Ogilvy

"jimmy" wrote in message
...
My excel file is in the d:Book1.xls, I type the following in the
sheet3 cell "E1", then E1 display 1900/1/0. How to use it to check
for the cell in "A1" is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy"
bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and the
sheet name). However, it returns nothing unless the workbook has been
saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to test?
Thanks..
"Bob Phillips"
.gbl...
You could create data validation for the column, let's say column E
for this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in
my addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the sheet
name "Feb", all the date in column in "A" other than February will
not be accepted and prompt a dialog box to ask the user to use
another sheet..

Thanks





















  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Check month

Solved now. Thank you.
"Bob Phillips" bl...
Try

Worksheets(Format(Date,"mmmm")).Activate

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
ic..thank you.
The 12 sheets have named as January to December, I wish to write the code
in the Workbook open() function that the current month sheet activate...I
tried MONTH(TODAY()).ACTIVATE but failed. What the code should be?

"Bob Phillips" bl...
This will vary the validation based upon the sheet name, so you can
apply the same formula to all sheets, not a different one to each.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"jimmy" wrote in message
...
Thank you..
In fact, what's the different between using this and just set
01-03-2007 to 31-03-2007 in the Data = Validation?

"Tom Ogilvy" bl...
First, the sheet must have a Month name, so change Sheet3 to Mar
Put this in cell E1 of the sheet named Mar (don't change the
formula - don't replace "filename")

=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

Now select Column A of the sheet named Mar

go to Data=Validation

Select Custom and in the textbox put in the formula

=Month(A1)=$E$1

and click OK.

--
Regards,
Tom Ogilvy

"jimmy" wrote in message
...
My excel file is in the d:Book1.xls, I type the following in the
sheet3 cell "E1", then E1 display 1900/1/0. How to use it to check
for the cell in "A1" is my specific valid month?

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("d:Book1.xls.Sheet3",A1),FIND("]",CELL("d:Book1.xls.Sheet3",A1))+1,99)&"-"&YEAR(TODAY())))



"Tom Ogilvy" bl...
Filename is an argument to the Cell worksheet function telling it to
return the fully qualified path and filename of the workbook (and
the sheet name). However, it returns nothing unless the workbook has
been saved once (so it has a fully qualified path and filename).

--
Regards,
Tom Ogilvy


"jimmy" wrote in message
...
Sorry, what is "filename" for?
I tried to copy & paste your formula to E1 but doesn't, how to
test?
Thanks..
"Bob Phillips" .gbl...
You could create data validation for the column, let's say column
E for this example, with a custom type and a formula of

=MONTH(E1)=MONTH(DATEVALUE("01-"&MID(CELL("Filename",A1),FIND("]",CELL("filename",A1))+1,99)&"-"&YEAR(TODAY())))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in
my addy)



"jimmy" wrote in message
...
Hi all,

How to set the entry in a specific column must in date type and
checking for this date must in a specific month? e.g. in the
sheet name "Feb", all the date in column in "A" other than
February will not be accepted and prompt a dialog box to ask the
user to use another sheet..

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
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Number of days in month counted from shortened name of month & yea Tumar Excel Worksheet Functions 6 September 18th 07 03:36 PM
copy worksheet from previous month and rename to current month Dan E. Excel Programming 4 December 8th 05 09:40 PM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


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

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"