+ Reply to Thread
Results 1 to 3 of 3

Multiple CSV in Folder, Delete Columns based on Header Name for Every File

  1. #1
    Registered User
    Join Date
    12-09-2019
    Location
    Seattle, WA
    MS-Off Ver
    2016
    Posts
    2

    Multiple CSV in Folder, Delete Columns based on Header Name for Every File

    I have a folder of CSV files. These files each contain columns that are named "First" and "Last"

    "First" and "Last" don't always appear in the same place in each CSV file... i.e. "First" is not always Column C, sometimes it's Column D, sometimes it's Column JJ. Same goes for "Last"

    I have been struggling to figure out a macro to go through every CSV in the folder and delete the columns based on the name "First" and "Last".

    Everything I find from searching online either is for static deletion (i.e. to delete Column J or Columns J:K) or to delete based on the name, but for different worksheets within the same workbook. Whenever I try to combine these two concepts I end up with compile or syntax errors.

    Can someone help me with this Macro? Please?

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Multiple CSV in Folder, Delete Columns based on Header Name for Every File

    Are you sure that they are really CSV files?

    CSV files do not have datas in columns like Excel.

    .

  3. #3
    Registered User
    Join Date
    12-09-2019
    Location
    Seattle, WA
    MS-Off Ver
    2016
    Posts
    2

    Re: Multiple CSV in Folder, Delete Columns based on Header Name for Every File

    Yes, they are Excel CSV files.

+ 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] Delete Multiple Columns based on Header Name
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2019, 04:07 AM
  2. [SOLVED] Macro to delete columns based on header
    By sfadam in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-25-2015, 05:15 PM
  3. Delete Columns( From One Sheet) based on the header name from a list.
    By v_a_royston in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-29-2015, 08:07 PM
  4. Macro to delete all columns in a workbook based on header name
    By Kencosgrove in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2015, 12:09 PM
  5. Sum multiple columns based on header
    By towndrunk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-14-2013, 10:00 AM
  6. Replies: 2
    Last Post: 10-13-2012, 03:30 AM
  7. Delete Columns Based on Header
    By MSmithson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2010, 03:19 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