By my experiences nohow. Therefore I wrote a macro that re-transform such
numbers to their original format:
Sub coltransform(transcol, rngstart, rngend, helpcol, formcode)
coldistance = Range(helpcol & 1).Column - Range(transcol & 1).Column
Range(transcol & rngstart & ":" & transcol & rngend).NumberFormat = "@"
Range(helpcol & rngstart).FormulaR1C1 = "=TEXT(RC[-" & coldistance &
"]," & " """ & formcode & """) "
Range(helpcol & rngstart & ":" & helpcol & rngend).Select
Selection.FillDown
Selection.Copy
Range(transcol & rngstart & ":" & transcol & rngend).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range(helpcol & rngstart & ":" & helpcol & rngend).ClearContents
End Sub
In your case the calling is this:
Call coltransform("A", 1, 100, "B", "000000000")
where the first four arguments are examples, the fourth is the real format
code for 9 digit numbers or rather 9 character long strings containing only
digits.
There is another benefit of using this sub: imported texts don't behave
normally in operations like Autofilter, Sorting, etc. This sub resolves this
problem too.
I hope it will be useful!
Regards,
Stefi
„LeePotts†ezt Ãrta: