Results 1 to 10 of 10

text to columns not working for me...frustrated

Threaded View

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    NW MN
    MS-Off Ver
    Excel 2010
    Posts
    17

    text to columns not working for me...frustrated

    I have an entire program written that seems to work every once in a while. The one thing that I CANNOT seem to figure out is the range for my text to columns. It is ALWAYS in cell A1, and the destination is ALWAYS A1. Sometimes it will work, and others it won't. I am puzzled. I am guessing something having to do with declaring object, or activeworkbook.worksheets(1).range("A1") needs to happen but I have tried a ton of things and still get a debug error.

    It might be helpful to say I am running this code through outlook, and calling excel. I am unsure if I needed to use "with activeworkbook" and run all my code with that declaration, but I had it then deleted it since I have been getting this error. This is the code for the text to columns. I have a rule set to run this script that saves the attachment, then opens it then needs delimit it. It has run through a few times and when it does it is exactly how I want it. I am guessing this is a simple fix. Thanks in advance!

    Dim rng As range
    Set rng = ws.range("A1")
    
           rng.TextToColumns Destination:=rng, DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
            Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
            :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
            Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
            ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _
            (20, 1)), TrailingMinusNumbers:=True
    Last edited by JBeaucaire; 10-15-2013 at 11:00 AM. Reason: fixed /CODE tag

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Text to Columns not working in Excel 2011
    By gcw in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 05-07-2013, 11:23 PM
  2. Text to Columns VBA code not working
    By bjcowen9000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2013, 11:42 AM
  3. VBA Text to columns not working correctly
    By UberFrank in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-13-2012, 09:59 AM
  4. Reresh All and Text to Columns Macro not working
    By Nick Daniel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2010, 06:55 AM
  5. Number stored as text: Frustrated with Excel-Word Merge
    By Marushel in forum Excel General
    Replies: 2
    Last Post: 03-11-2006, 12:50 AM

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