+ Reply to Thread
Results 1 to 4 of 4

Macro that can be applied to any workbook that needs same editing

  1. #1
    Registered User
    Join Date
    01-31-2017
    Location
    Philippines
    MS-Off Ver
    15
    Posts
    18

    Red face Macro that can be applied to any workbook that needs same editing


    Hi experts, I'm really stressed on how can i easily delete all unnecessary
    columns & rows, and then combining the text in J , U and V column.

    I want file #1..
    to become file #2.

    I already tried macro recording and saving the macro in my personal workbook but
    when i run the same macro on other work book, its not working. Honestly, my knowledge in using
    vba is very little so i really need your help.
    Attached Files Attached Files
    Last edited by khr0n0s; 03-09-2018 at 02:54 AM. Reason: requested by admin

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Please, I need macro to utilize this file for my work.

    Hi khr0n0s,

    Using Power Query the new tool built into Excel, your problem took me about 2 minutes. PQ is called Get & Transform in 2016 Excel.

    Here is the Query

    Please Login or Register  to view this content.
    But I didn't need to write any of the code above. Open the attached and then look at the Power Query and edit it. It is much easier than VBA code to do this stuff.

    Power Query CSV1 to 2.xlsx

    If you put the 1.csv on your desktop and change the source of the above code you can repro what I did. OR - Learn a bit more about Power Query.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    01-31-2017
    Location
    Philippines
    MS-Off Ver
    15
    Posts
    18

    Re: Please, I need macro to utilize this file for my work.

    Quote Originally Posted by MarvinP View Post
    Hi khr0n0s,

    Using Power Query the new tool built into Excel, your problem took me about 2 minutes. PQ is called Get & Transform in 2016 Excel.

    Here is the Query

    Please Login or Register  to view this content.
    But I didn't need to write any of the code above. Open the attached and then look at the Power Query and edit it. It is much easier than VBA code to do this stuff.

    Attachment 564783

    If you put the 1.csv on your desktop and change the source of the above code you can repro what I did. OR - Learn a bit more about Power Query.
    I'm a little lost..so can i load and apply the query in different workbook with different data so that i won't go through manually edit every workbook again?

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Macro that can be applied to any workbook that needs same editing

    If your CSV file always looks like what you gave, then yes.

    You also need either Excel 2016 which has the "Get & Transform" tool or download it and use it as an Add-in called Power Query if you have Excel 2010 or 2013. I also believe you need to be using the PC (not Mac) version of Excel.

    Search on Power Query and see some examples of PQ and how to use it.

+ 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. [SOLVED] This macro did not work well, change to text File
    By muharom.habib in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2017, 09:35 PM
  2. Changing Macro to utilize Arrays
    By arpirnat in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-22-2016, 02:07 PM
  3. [SOLVED] cannot work out how to open a .chm help file in a macro
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2014, 06:17 AM
  4. Macro does not work when file is sent to another computer
    By brdstyle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2013, 01:51 AM
  5. [SOLVED] Use a Macro or VBA to utilize a command to e-mail selected cells to predetermined e-mail
    By jstn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2013, 10:39 AM
  6. Macro to save file as pdf that will work on both PC and Mac
    By Ricky Wilko in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2013, 07:25 PM
  7. Print to file .xls macro does not work
    By mgalterio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 01:22 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