LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Force a cell to display as Text

1. Open excel, go to tools/Macro/Record new Macro.

2. Do, what you want to do with Excel, i.e. change cell formating to text.
3. Go to tools/Macro/Stop recording
4. Click Alt-F11 to open VB Editor
5. Find your project and usualy Module1 module.
6. Look at the code generated by macro recorder.

you will find:

Sub Macro1()
Selection.NumberFormat = "@"
End Sub


Now, you know how people know what to put as number format. :)




Julie wrote:
The "@" symbol worked. Thanks.

I don't understand what you mean by "recording a macro within excel". I
really haven't done any macros in Excel, nor any VBA. I've only programmed in
.NET C#, using Visual Studio Tools For Office.

"Dave Peterson" wrote:


myRange.numberformat = "@"

Sometimes you can get the answer by recording a macro within excel.



 
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
How to force a wrap text function when the cell is big enough to p Jason Bathon Excel Discussion (Misc queries) 1 April 13th 05 03:21 PM
How can I force certain text formatting in a cell? eddied Excel Discussion (Misc queries) 2 February 7th 05 12:55 PM
How to force userform to display everything? John Mitchell Excel Programming 3 October 13th 04 12:41 PM
Macro to force text to rol to next cell d_low Excel Programming 1 December 16th 03 12:40 PM
force text in a cell based on value of cell in a range jjst34 Excel Programming 7 December 2nd 03 10:23 PM


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