Using VBA to go from text to general number format

  • Thread starter Thread starter mika.
  • Start date Start date
M

mika.

Sorry, I need to rewrite my question. Here is my code:

Selection = Selection.Resize(columnsize:=1).Select
Selection.Cells.NumberFormat = "General"
Selection.Formula = "=Submitter!$F$2"
Selection.Cells.NumberFormat = "Text" 'Error line

Unfortunately, the last line gives me the error "Run-time
error '1004': Unable to set the NumberFormat property of
the Range class. Any ideas as to why? The second line
works fine...

Thanks,
Kim
 
Mika,

Is this what you want

Selection = Selection.Resize(columnsize:=1).Select
Selection.Cells.NumberFormat = "General"
Selection.Formula = "=Submitter!$F$2"
Selection.Cells.NumberFormat = "@" 'Error line


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top