+ Reply to Thread
Results 1 to 3 of 3

TextToColumns fails in macro

  1. #1
    Registered User
    Join Date
    05-17-2007
    Location
    Western Washington
    Posts
    2

    TextToColumns fails in macro

    Hi folks,
    I'm relativitily new to macro coding so please be excuse me if I don't commuicate correctly. I have a macro that I want to loop thru several sheets in a workbook. I need to reformat a column into several columns for further processing. I am trying to use TextToColumns to get the results. If I create a macro and run it individually on each sheet it works. But when I add and modify the code to a looping macro, I get a failure:

    Run-time error'1004'
    TextToColumns method of Range class failed

    Here is the complete macro:
    Please Login or Register  to view this content.

    Any thoughts or assistance would be greatly appreciated.
    TIA
    Last edited by VBA Noob; 10-11-2007 at 04:30 PM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I think your macro can have problem because you select some sheets but your loop include all sheets but over all because you try to use a select instruction in a sheet not activated.

    Try to use this macro (I modified a little):
    Please Login or Register  to view this content.
    I hope it can help.

    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    05-17-2007
    Location
    Western Washington
    Posts
    2

    Smile Thanks

    Anoka05,

    That made it work. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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