Senin, 01 November 2021

VBA TEXT TO COLUMNS - FIXED WIDTH DATA TYPE

I want to make columns from text type to general type,

because when i tried to vlookup the data, the values were got #N/A.


Worksheet name = MP

Column target D1:D10000

its work code from text to general vba:

VBA TEXT TO GENERAL


ThisWorkbook.Sheets("MP").Activate

ThisWorkbook.Sheets("MP").Range("D1:D10000").Select

Selection.TextToColumns DataType:=xlGeneralFormat, _

    ConsecutiveDelimiter:=False, Space:=False



You can modify Data type likes below,


xlColumnDataType

XLCOLUMNDATATYPE
XlColumnDataType can be one of these XlColumnDataType constants.
xlGeneralFormat. General
xlTextFormat. Text

xlMDYFormat. MDY Date

xlDMYFormat. DMY Date

xlYMDFormat. YMD Date

xlMYDFormat. MYD Date

xlDYMFormat. DYM Date

xlYDMFormat. YDM Date

xlEMDFormat. EMD Date

xlSkipColumn. Skip Column



Hope can help you.