ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Name Range Format (https://www.excelbanter.com/excel-discussion-misc-queries/163793-name-range-format.html)

David T

Name Range Format
 
Hello Experts

I have a macro code that combines a name range (which is a date) with the
word "Total". The only problem with this is that the new word is not in the
format I want. The combined word looks like this:

09/01/2007 Total

I want it to look like this.

Sept 2007 Total

I attached my code below. Can anyone help?

David

Sub Trim1()
For Each c In Worksheets("CoverSheet").Range("c27:c32").Cells
If (c.Value) Like "*" Then c.Value = Range("Production_Month") & " "
& "Total"

Next
End Sub


Chip Pearson

Name Range Format
 
Try

If (c.Value) Like "*" Then c.Value = Format(Range("Production_Month"),"mmm
yy") & " " & "Total"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"David T" wrote in message
...
Hello Experts

I have a macro code that combines a name range (which is a date) with the
word "Total". The only problem with this is that the new word is not in
the
format I want. The combined word looks like this:

09/01/2007 Total

I want it to look like this.

Sept 2007 Total

I attached my code below. Can anyone help?

David

Sub Trim1()
For Each c In Worksheets("CoverSheet").Range("c27:c32").Cells
If (c.Value) Like "*" Then c.Value = Range("Production_Month") & "
"
& "Total"

Next
End Sub



David T

Name Range Format
 
Chip-

You are awesome!!! Thanks!!!!!!!!!

"Chip Pearson" wrote:

Try

If (c.Value) Like "*" Then c.Value = Format(Range("Production_Month"),"mmm
yy") & " " & "Total"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"David T" wrote in message
...
Hello Experts

I have a macro code that combines a name range (which is a date) with the
word "Total". The only problem with this is that the new word is not in
the
format I want. The combined word looks like this:

09/01/2007 Total

I want it to look like this.

Sept 2007 Total

I attached my code below. Can anyone help?

David

Sub Trim1()
For Each c In Worksheets("CoverSheet").Range("c27:c32").Cells
If (c.Value) Like "*" Then c.Value = Range("Production_Month") & "
"
& "Total"

Next
End Sub




All times are GMT +1. The time now is 12:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com