Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Th eproblem with cstring is it adds an extra space in front of the number as
a place holder for a positive or neagive sign. Excel will automatically convert a number string to a real number if the cells is formated as General or Number format. You need to format the cell to text (numberformat = "@") before you put the number into the cell to stop the number from changing. You should also use variables in VBS declared as strings if you are not directly copying the number from one workbook to the other. I've had to in the past specifically move numbers in excel to a string variable in VBA and then write to excel to prevent any changes of the numbers. "u473" wrote: Thank you for your answer, but Data Type 1 is Numeric, Type 2 is String. The field I need to import has a mix of Type 1 and Type 2. I need to have them all converted to Type 2. My current syntax attempts with cString(MyNumber) or NumberFormat= "@" did not produce satisfactory results. I am still searching. Thank you for your help, J.P. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert numeric field from type 1 to type 2 | Excel Programming | |||
how to convert date type to text type | Excel Discussion (Misc queries) | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Adding new 'Type' to Format->Number->Time->Type | Excel Discussion (Misc queries) |