View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Update this macro to make it generate a counter as text

Hi,

Am Wed, 17 Oct 2012 14:02:38 -0700 (PDT) schrieb B Roberson:

I got the leading zeros but I had trouble with it uploading to this database and had to go back and do a formula =istext() on the resulting cells and found that they were not actually text. So, my question is how do I get them to display like this but actually be text? I used an =text()sometimes to bring a number over as text. Is there an alternative to that here?


try:
With Range("D1:D" & cRows)
.Formula = "=text(row(),""000"")"
.Copy
.PasteSpecial xlPasteValues
End With


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2