Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Formatting in VBA

Hi Michael

Start the value with a single apostrophe to make
Excel treat the value as text:

Range("C" & 6 + y).Value = "'" & Format(BottomRange(y), "#,##0") & " - "
etc.

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only, please.

"Michael J. Malinsky" skrev i en meddelelse
...
I have the following line of code:

Range("C" & 6 + y).Value = Format(BottomRange(y), "#,##0") & " - "

&
_
Format(TopRange(y), "#,##0")

BottomRange(0) = 1
TopRange(0) = 10
BottomRange(1) = 2
TopRange(1) = 11

So cell C6 should show 1-10 and C7 should show 2-11. Excel, in its

infinite
wisdom, automatically converts the result to a date format which shows as
10-Jan and 11-Feb, respectively. I want to keep the format function as
there are times when the amounts will be greater than those that would
generate this type of output. How can I get the output I want?

TIA
Mike

--
Michael J. Malinsky





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
condionally formatting based on another cells formatting? Derrick Excel Discussion (Misc queries) 2 July 31st 09 08:05 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM
expanding custom formatting without removing existing cell formatting? Keith Excel Worksheet Functions 3 December 27th 06 01:54 PM


All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"