Thread: data format 99
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
witek witek is offline
external usenet poster
 
Posts: 69
Default data format 99

Ray wrote:
I am using the following array to obtain data from a worksheet:
zs_subldeger = (Range(Cells(row_set, 1), Cells(lastrow, 1)))
The value of the cell is 0001 however the data is read as a numeric value
of 1?
How do I retain the text value 001?

When I Dim zs_subldeger as string I get a type mismatch error .

Thanks


dim zs_subldeger as string
zs_subldeger = Format$((Range(Cells(row_set, 1), Cells(lastrow, 1))),"000")


Is it what you need?