+ Reply to Thread
Results 1 to 8 of 8

Modify macro to repeat once, accept a different file type and paste into different columns

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Australia mate!
    MS-Off Ver
    Excel 2010
    Posts
    15

    Modify macro to repeat once, accept a different file type and paste into different columns

    CULVERT_131720.txtBrilliant Job.xlsmHowdy,
    Can someone help me with the code below.

    Firstly, i run this macro to import a text file into a set format and it works great for that. (results to 4 columns of text & data into Cols A-D)

    I want to run the macro again to import another file OR have it loop ?
    I am trying to get the results of the second run into the same worksheet into cols E-H.

    On a side matter, instead of running on a *.txt file, does anyone know how i could change it to accept *.crd files by default? (same file just different extension)

    Thanks in anticipation.
    With thanks to "rscsmith" for this code below which i have modified to suit.


    Please Login or Register  to view this content.
    Last edited by vegetable; 08-02-2013 at 08:36 PM. Reason: add files for testing

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    Please Login or Register  to view this content.
    Last edited by patel45; 07-29-2013 at 11:22 AM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    10-24-2012
    Location
    Australia mate!
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    Wow, thanks patel45. That is bellisimo!. I sort of knew what needed to be done,but had no idea how.

    Do you know how to change it so it opens a *.crd file instead of a *.txt? This will save me from manually changing the file's extensions every time before i use the macro.

    I have had a go at it by changing the user form and module 1, but the data won't appear in the worksheet (and no errors either?). My thinking is "All Files" and setting *.crd instead of *.txt or something like that......?

    And for taking the time to help me? Thanks again.

    Vegie.
    Last edited by vegetable; 07-30-2013 at 12:39 AM.

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-24-2012
    Location
    Australia mate!
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    Thanks again patel45. I realised my problem with the crd file was that it somehow was empty..... thus i thought the macro wasn't working with it.

    Another question I have on this is when i took it to another computer, and tried to run it, even though the files were populated in the list, it would not import them saying that files were not found. I think it was runtime error 1009. I had the files on a flash drive E:/
    On debug, it highlighted the code below in yellow as being the problem.

    Please Login or Register  to view this content.
    I am considering a project towards the end of this year where i will need some help. patel45, are you interested in some paid excel work?

    cheers, vegie.

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    Please Login or Register  to view this content.
    Last edited by patel45; 08-03-2013 at 08:04 AM.

  7. #7
    Registered User
    Join Date
    10-24-2012
    Location
    Australia mate!
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    Thanks patel45. Works well.

    Salute.

  8. #8
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Modify macro to repeat once, accept a different file type and paste into different col

    I sent you a private message

+ 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. Modify Excel macro to repeat up all rows
    By pgugger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2012, 10:44 AM
  2. [SOLVED] Need to modify Macro to repeat sequencial statement
    By jonrack in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-03-2012, 02:38 PM
  3. Modify a Macro to Repeat for all Selected Worksheets
    By carl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2006, 01:00 PM
  4. [SOLVED] Can I modify Excel 2003 color palette to accept Pantone colors?
    By snowmobile in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  5. Can we modify the macro to accept multi-inputs?
    By J_J in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2005, 07:06 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