Advertisement

05.04.2008 at 03:03PM PDT, ID: 23375310
[x]
Attachment Details

VBA  Display month NAME based on date that is formatted GENERAL

Asked by redrumkev in Microsoft Excel Spreadsheet Software, Spreadsheet Software

Tags: Excel, 2003

Experts,

Within my VBA code (ThisWorksheet - Sub SortImportedData_To_TEMP) (see attached) it ends up creating formatted output on worksheet TEMP.

What I need to do is calculate EFFECTIVE MONTH (Column T, starting on row 2, fill down) based on EFFDATE (Column S, starting on row 2).

Example

01/01/2008 would be EFFECTIVE MONTH       JANUARY
04/19/2008 would be EFFECTIVE MONTH       APRIL

Thus using the digit of month from EFFDATE to provide a month (in all capitals).

I tired to use a formula such as =S2 (in T2) and then change the formatting to MMMM, which displays the month, but had two problems.

First of all this does not work because (I think) that the dates in column S are not really dates but formatted as general.
Second, if I do put in a real date and then use the formula, I get April (Proper, not UPPER) formatting.

So do I need to have a statement that looks at the first characters and then selects a date based on those? Such as:

If (S2 is equal to 01*), then JANAURY
If (S2 is equal to 04*), then APRIL

Possible workings for the above (I have been using Sheets.(LIST)) as storage for lookup ranges, so it could be added there, to the right of carrier. Or perhaps it should just be a formula; I am not sure, guess thats why I am asking here!

Thank you in advance!

Regards,
Kevin

***edited for content, M_matt***Start Free Trial
[+][-]05.04.2008 at 03:08PM PDT, ID: 21497125

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Spreadsheet Software
Tags: Excel, 2003
Sign Up Now!
Solution Provided By: jpaulino
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628