Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Running text2column for column A:A

$
0
0

I am quite new to VBA scripting, but I have to perform the following actions:

  • convert a csv file to xls one
  • in the saved xls file to perform the following actions: 1. To run Text To Columns for the data 2. To define the type of each column ( amount , date, text). 3. To make the first 0 in Amount&Date columns be visible ( e.g. "04521.6823"& for date "05/02/2020"). Here I plan to use .NumberFormat option.

I succesfully converted the file, but cannot perform Text2Column part. My data is only in column A, separator ";", only on sheet1. Here is the latest code I ran:

 Sub text2columns()
    Dim rg As Range

    Set rg = Range("A:A").CurrentRegion

    rg.TextToColumns Destination:=Range("A:A"), ConsecutiveDelimiter:=True, DataType:=xlDelimited, Space:=True

    End Sub

Can anyone help me? I know questions are basic, but need some help to continue. Thank you!


Viewing all articles
Browse latest Browse all 88854


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>