Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default need to split month out from date formatted cell

Hi, I have a workbook that is used throughout the company.
My boss wants to report on certain fields based on month.
The only problem is that all cells with a date in them are
all mm/dd/yy. I want to present my boss with a userform
that will ask her what month she wants, then go to any
worksheet and get the information she needs.

How can I query the date cells with only a 2 digit month?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default need to split month out from date formatted cell


From the UserForm take the month number say in ReportMonth variable

Test this against the value in the cell (eg A1) holding the date for
selection using

If ReportMonth = Month(Range("A1")) Then
' do code - the month matches
End If

Cheers
N

"John R." wrote in message
...
Hi, I have a workbook that is used throughout the company.
My boss wants to report on certain fields based on month.
The only problem is that all cells with a date in them are
all mm/dd/yy. I want to present my boss with a userform
that will ask her what month she wants, then go to any
worksheet and get the information she needs.

How can I query the date cells with only a 2 digit month?

Thanks





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default need to split month out from date formatted cell

Hi again, but the current content of the cell is say
11/21/03, and the next cell in the column is 11/25/03, the
next cell might be 07/30/02. How do I only get rows in
which the month is 11? Sorry I'm new to VB and don't quite
understand the code you have written.

-----Original Message-----

From the UserForm take the month number say in

ReportMonth variable

Test this against the value in the cell (eg A1) holding

the date for
selection using

If ReportMonth = Month(Range("A1")) Then
' do code - the month matches
End If

Cheers
N

"John R." wrote in

message
...
Hi, I have a workbook that is used throughout the

company.
My boss wants to report on certain fields based on

month.
The only problem is that all cells with a date in them

are
all mm/dd/yy. I want to present my boss with a userform
that will ask her what month she wants, then go to any
worksheet and get the information she needs.

How can I query the date cells with only a 2 digit

month?

Thanks





----== Posted via Newsfeed.Com - Unlimited-Uncensored-

Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the

World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total

Privacy via Encryption =---
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default need to split month out from date formatted cell

I guess I should also tell you that I'm storing the month
she picks into x1 of my worksheet, I then have to query a
closed workbook to get the information for the month she
has picked.

I'm also using Excel 97 on a Win2k machine.
-----Original Message-----
Hi again, but the current content of the cell is say
11/21/03, and the next cell in the column is 11/25/03,

the
next cell might be 07/30/02. How do I only get rows in
which the month is 11? Sorry I'm new to VB and don't

quite
understand the code you have written.

-----Original Message-----

From the UserForm take the month number say in

ReportMonth variable

Test this against the value in the cell (eg A1) holding

the date for
selection using

If ReportMonth = Month(Range("A1")) Then
' do code - the month matches
End If

Cheers
N

"John R." wrote in

message
...
Hi, I have a workbook that is used throughout the

company.
My boss wants to report on certain fields based on

month.
The only problem is that all cells with a date in them

are
all mm/dd/yy. I want to present my boss with a userform
that will ask her what month she wants, then go to any
worksheet and get the information she needs.

How can I query the date cells with only a 2 digit

month?

Thanks





----== Posted via Newsfeed.Com - Unlimited-Uncensored-

Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the

World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total

Privacy via Encryption =---
.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default need to split month out from date formatted cell

John

You might find that an advanced filter is what you need.
See Deborah Dalgliesh's site Contextures.com

The criterion to filter November's data would be
=MONTH(A11)=11 if the dates are in column 1 and the list
starts at row 11.

You can use an inputBox for the manager to to insert the
month number with somthing like

x = Inputbox("Enter the number of the month")
range("a2")= "=MONTH(A11)=x"

Deborah shows how to extract certain fields to another
place

Peter Atherton
-----Original Message-----
Hi, I have a workbook that is used throughout the

company.
My boss wants to report on certain fields based on month.
The only problem is that all cells with a date in them

are
all mm/dd/yy. I want to present my boss with a userform
that will ask her what month she wants, then go to any
worksheet and get the information she needs.

How can I query the date cells with only a 2 digit month?

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
cell formatted as date won't change NEHicks Excel Discussion (Misc queries) 5 March 14th 21 11:52 AM
Extract the Month from a cell with a formatted date Alcadia Excel Discussion (Misc queries) 3 February 1st 10 03:06 PM
Split date from date time cells dd/mm/yyyy hh:mm. New cell dd/mm/y nigeo Excel Discussion (Misc queries) 3 April 1st 09 09:38 PM
Extracting date from Date and Time formatted cell Aviral Sharma Excel Discussion (Misc queries) 2 March 6th 09 05:04 AM
how do i add 1 year to a date formatted cell? rogerm Excel Worksheet Functions 5 September 4th 05 06:46 AM


All times are GMT +1. The time now is 10:08 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"