+ Reply to Thread
Results 1 to 2 of 2

text to columns method using vba

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2016
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    67

    text to columns method using vba

    Hi lads,

    I have the dates column pulled from another worksheet. Some dates are in date format (dd/mm/yyyy) and some in text format. If I will do data -> text to columns manually, it will convert all into the date format. But I need to do it using vba. I have written the vba script for that but unfortunately it's not working, could you guys please help? Thanks in advance...

    "results" is the sheet name and the dates are in "B" column. I want the dates to be copied on the same column without any message came up like there is already data here, do you want to replace it?


    Worksheets("results").Range("B:B").SpecialCells(xlCellTypeConstants).TextToColumns _
    Destination:=Worksheets("results").Range("$B$1"), _
    DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, _
    Tab:=True

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    05-09-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    148

    Re: text to columns method using vba

    Hello Abhi,

    Please provide a file with example-data

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run-time error '1004' Text to columns method of range class failed
    By issa992 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2021, 08:35 PM
  2. Loop columns using RC method
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-10-2020, 07:33 AM
  3. Method to check duplicate values that appear across ALL columns
    By Jnehra in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-31-2019, 03:01 PM
  4. [SOLVED] copy rows into last columns....best method?
    By Quint6778 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2018, 10:39 AM
  5. [SOLVED] method for importing .txt files into separate columns
    By microsofteggshell in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-14-2013, 09:36 AM
  6. Columns(X).Delete method not working
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2013, 07:40 PM
  7. Find method on columns?
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2008, 06:28 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1