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