Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quick month formatting question 2

Status
Not open for further replies.

westma

Technical User
Jul 16, 2003
74
US
Hi. In one cell a user enters 1-12 depending on the desired month. In another cell, the name of the month should appear. However, January is the only thing that appears. I know that this is because these numbers represent so many days after January 1, 1900. How do I get around this? Thank you!
 
Create a public function in a module:
Public Function myMonthName(myMonthNum)
myMonthName = MonthName(myMonthNum)
End Function
Then in the cell you can enter this formula:
=myMonthName(A1)
you may obviously make the code more robust ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
or....

enter this formula
[tt]
=TEXT(DATE(YEAR(TODAY()),A1,1),"mmmm")
[/tt]
where A1 contains a month numeric value.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
OK, now I want to use this function in a chart title so that month appears there as well. For some reason it keeps giving me an error. Any thoughts? Thank you very much for your help!
 
What kind of error?

Exactly what are you doing and at what point do you get the error?

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
I click on the title box in my graph, then click in the formula box, and enter =Sheet1!A1&" Some text here"
and it says:

The formula you entered contains an error. Try one of the following. . .blah blah blah.

If I just put =Sheet1!A1, the month appears in the chart title just fine, but it won't let me add text after it.
 
Add you text in the CELL instead.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
And this ?
enter =Sheet1!A1[highlight] [/highlight]&[highlight] [/highlight]" Some text here"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you for your help Skip and PH. I may have one more complicated question to ask about this chart. But I will ask it later, after I play with it for a while.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top