View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
external usenet poster
 
Posts: 644
Default format cells as "Text"

Range("A:B").NumberFormat= "@"

HTH

Die_Another_Day

Phaedrus wrote:
Hi,

I'm copying a some numerical -codes into a range (say "A:B"), some of
the codes starts with a zero so, after copy Excel converts them numbers
and removes the leading zero.
This is creating a slight problem in my program.

If anybody knows a way to format the range as Text or String, using VBA
in a macro, please let me know.

I cannot do the excel formatting and save the sheet coz' the sheet is
created based on certain user-input.

Thanks in Advance,
Maneesh Hari