Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RaY RaY is offline
external usenet poster
 
Posts: 164
Default data format 99

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

--
Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default data format 99

witek wrote:
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?


or even better

zs_subldeger = Format$((Range(Cells(row_set, 1), Cells(lastrow,
1))),Range(Cells(row_set, 1), Cells(lastrow, 1)).NumberFormat)
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
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Increase Your Business By Data Conversion, Data Format and Data EntryServices in India Data Entry India Excel Worksheet Functions 1 March 31st 08 12:51 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
Data in Cross-Tab format: needs to be written in Table Format runyan Excel Programming 2 October 4th 05 07:58 AM
code for converting data format in another format mistral Excel Programming 0 August 19th 04 04:50 PM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"