Data Type Mismatch in excel

Hi,

Im comparing 2 excel sheets with same columns (sheet1 and sheet2) using SQL Query but in both sheets the datatype for the column changes for example:
Sheet1
EmpID
1
2
3

Sheet2
EmpID

0001
0002
0003

Now i want both the data in same type like i want to convert Sheet1-EmpID ->
“1” to “0001” (this format). How to convert like this. Please help.
Thanks

Hi,

Just read the sheet and do something like
Stringvariable.padleft(4,CChar(“0”))
This would work.

Thanks

Hi Thanks for the response. Here what do u mention as “Stringvariable” because i have a huge employee data base i want one particular column (Emp_ID) to format not the whole sheet. IS that Possible?

numbervariable.ToString(“0000”) transforms numbers into strings like :

1 -> 0001
20 -> 0020
999-> 0999