+ Reply to Thread
Results 1 to 6 of 6

How to put the code in a for loop or simplifing the code

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    8

    How to put the code in a for loop or simplifing the code

    Hi all,

    I dont want to paste eight time of the below code, is there any way to simplify the code
    Thanks a lot for all your attention

    For each column which is (D:K)

    DO
    Please Login or Register  to view this content.
    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 10-09-2013 at 02:58 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to put the code in a for loop or simplifing the code

    You need to explain more about what you are trying to do. Probably posting a workbook containing before and after data layout would help.

    If you have data in columnd D:K then surely the first TextToColumns for column D would overwrite some if not all the columns to the right?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-09-2013
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to put the code in a for loop or simplifing the code

    I got a table exporting from access and I would like to formating the info from D column to K column as text, so I use TextToColumns

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to put the code in a for loop or simplifing the code

    Can you post example file

    Are you saying the content of column D does not contain any TABS

  5. #5
    Registered User
    Join Date
    10-09-2013
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to put the code in a for loop or simplifing the code

    As attached is the file I export from the access database, I want to do some statistic base on the D column to K column, but before doing that, I have to turn these column into string and that's why I need to use column-to-text to manipulate the data first
    Attached Files Attached Files

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to put the code in a for loop or simplifing the code

    I don't know whether your example is the output or input.

    Please Login or Register  to view this content.

+ 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. Loop the code
    By mayurpatil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 04:05 PM
  2. Code to turn this code into a loop doing muliple copies
    By fbplaya02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2013, 12:02 PM
  3. Loop Through Code
    By NoCanDo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2008, 08:28 AM
  4. [SOLVED] Help with better loop code
    By Sliman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-16-2006, 01:52 PM
  5. [SOLVED] Help Simplifing Code
    By Joel Mills in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2005, 04:06 PM

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