#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default 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


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
Lookup a value when the range contains a high - low format rpalarea Excel Discussion (Misc queries) 3 August 7th 07 04:59 PM
conditional format a range Wanna Learn Excel Discussion (Misc queries) 3 October 11th 06 02:14 PM
how do i format a cell based on format of a range of cells? Chris Hardick Excel Discussion (Misc queries) 2 April 3rd 06 08:54 AM
Conditional format IP range deo89 Excel Discussion (Misc queries) 4 December 29th 05 02:56 AM
Format Telephone Cell Range Victor Costello Excel Worksheet Functions 2 October 2nd 05 07:42 PM


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