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

Hi

To format a range as General in VBA I use a code row like this:
....
ThisWorkbook.Sheets("Forecast").Range("A1").Offset (k, 2).NumberFormat = "@"

I have searche desperately for it, but I didn't find a way to set the range
to be formatted as Text (i.e. after the VBA formats the range, cell format
shows it formatted as Text). I tried to record a macro when formatting the
range as text manually, but all I did get back, was the same code for
setting format to General

Thanks in advance for your help!

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Excel2000: Formatting a range as Text in VBA

Hi Arvi,

To format as general:

Selection.NumberFormat = "General"

To format as text:

Selection.NumberFormat = "@"

---
Regards,
Norman



"Arvi Laanemets" wrote in message
...
Hi

To format a range as General in VBA I use a code row like this:
...
ThisWorkbook.Sheets("Forecast").Range("A1").Offset (k, 2).NumberFormat =
"@"

I have searche desperately for it, but I didn't find a way to set the
range to be formatted as Text (i.e. after the VBA formats the range, cell
format shows it formatted as Text). I tried to record a macro when
formatting the range as text manually, but all I did get back, was the
same code for setting format to General

Thanks in advance for your help!

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel2000: Formatting a range as Text in VBA

Thanks!


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )



"Norman Jones" wrote in message
...
Hi Arvi,

To format as general:

Selection.NumberFormat = "General"

To format as text:

Selection.NumberFormat = "@"

---
Regards,
Norman



"Arvi Laanemets" wrote in message
...
Hi

To format a range as General in VBA I use a code row like this:
...
ThisWorkbook.Sheets("Forecast").Range("A1").Offset (k, 2).NumberFormat =
"@"

I have searche desperately for it, but I didn't find a way to set the
range to be formatted as Text (i.e. after the VBA formats the range, cell
format shows it formatted as Text). I tried to record a macro when
formatting the range as text manually, but all I did get back, was the
same code for setting format to General

Thanks in advance for your help!

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )





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
Excel2000:How to link Print Area with a named range Arvi Laanemets Excel Worksheet Functions 5 April 8th 08 02:35 PM
Excel2000: UDF's parameter as cell range OR array Arvi Laanemets Excel Programming 2 April 19th 05 02:27 PM
Printing date range in excel2000 No Name Excel Programming 1 November 18th 04 02:13 PM
Excel2000: Reading Named Range value from VBA Arvi Laanemets Excel Programming 2 July 9th 04 09:01 AM
Excel2000: finding last row of used range Arvi Laanemets Excel Programming 2 May 10th 04 08:54 AM


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

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"