View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default I need the original digit format with zeroes untrimmed

On Mon, 25 Oct 2004 17:27:22 +0200, "alfonso gonzales"
wrote:

Hello,
My query is about how to retain an 8 digit format while copying data values
from one file to another.
I have a dbf file with one column containing 8 digit indexes. When I copy
some of those into an excelworksheet I get some of the indexes that start
with the zero trimmed, eg. 7063004 instead of 07063004. Now, it is
important that the indexes I copy are displayed and operated on as 8-digit
values (including the initial zeroes). How can I do that?


In order to ensure the leading zeros, I believe you need to treat the value as
a properly formatted string, or format the cell in which the index is displayed
as "00000000"

For example:

dim Indx as String
Indx = Format(num,"00000000")


--ron