3 Replies - 429 Views - Last Post: 05 June 2018 - 04:46 AM Rate Topic: -----

#1 ajayscv   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-May 18

VBA: Split Sheet to CSV files based on Column

Posted 28 May 2018 - 07:44 AM

I have a file of received items in the company. I need to split the File into CSV files based on the Scanner Number (HHT Name). The main in this is like I would like to select the columns only which columns need to be exported in csv (from 3 -6 columns based on the Brand, with or without Header row

Please help.


Barcode Item No. Description Variant Code HHT Name Rack Code Qty.
9348989137333 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009030 109 14 18
9348989137333 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009030 109 101 4
9348989137333 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009030 111 69 8
9348989137340 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009032 109 14 6
9348989137340 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009032 111 41 30
9348989137340 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009032 111 69 16
9348989137340 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009032 113 43 8
9348989137357 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009034 111 36 30
9348989137357 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009034 111 77 16
9348989137357 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009034 113 43 6
9348989137364 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009036 109 14 4
9348989137364 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009036 111 77 8
9348989137364 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009036 112 102 11
9348989137364 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 009036 113 43 4
9348989137388 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 390128 111 40 6
9348989137395 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 390130 109 38 6
9348989137395 R03CBOCI7 MIRAGE AGGROFLORAL BOARDSHORT 390130 111 38 9

Is This A Good Question/Topic? 0
  • +

Replies To: VBA: Split Sheet to CSV files based on Column

#2 andrewsw   User is offline

  • dependency injected
  • member icon

Reputation: 6668
  • View blog
  • Posts: 27,305
  • Joined: 12-December 12

Re: VBA: Split Sheet to CSV files based on Column

Posted 29 May 2018 - 12:34 AM

What have you tried or discovered? Post any code attempt.
Was This Post Helpful? 0
  • +
  • -

#3 ajayscv   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-May 18

Re: VBA: Split Sheet to CSV files based on Column

Posted 01 June 2018 - 01:32 AM

View Postandrewsw, on 29 May 2018 - 12:34 AM, said:

What have you tried or discovered? Post any code attempt.

Hi Andrew,

Thank you for supporting me on this.

So far i made some changes in the Idea, Sorry for that.

But the idea got improved. May be you can amend a little bit in Code to fit for my needs.

I have created a User Form to get the needed with the help of some other codes retrieved from internet. Please have a look at the codes and user form and advise.

The whole idea is like Double clicking the Headers in the Listbox 1 will select and copy the Header to ListBox 2 where you can adjust the order of the Columns with Up and Down command Buttons. Then Combobox1 will allow us to select the reference Column for Spliting (HHT in the initial request), and Combobox2 will select the starting row and Combobox3 will select the file type.

There is a function in the Code for selecting the Destination Folder ( GetFolder() ) which will be shooting when we press the Split button and will split the sheet into files to the selected folder.

Please see the attached Excel File for reference and advise how can we meet the needful from the code


NB. I couldn't link my user form with a button, so you need to open VBA editor manually


Thanks in Advance

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#4 ajayscv   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-May 18

Re: VBA: Split Sheet to CSV files based on Column

Posted 05 June 2018 - 04:46 AM

View Postajayscv, on 01 June 2018 - 01:32 AM, said:

View Postandrewsw, on 29 May 2018 - 12:34 AM, said:

What have you tried or discovered? Post any code attempt.

Hi Andrew,

Thank you for supporting me on this.

So far i made some changes in the Idea, Sorry for that.

But the idea got improved. May be you can amend a little bit in Code to fit for my needs.

I have created a User Form to get the needed with the help of some other codes retrieved from internet. Please have a look at the codes and user form and advise.

The whole idea is like Double clicking the Headers in the Listbox 1 will select and copy the Header to ListBox 2 where you can adjust the order of the Columns with Up and Down command Buttons. Then Combobox1 will allow us to select the reference Column for Spliting (HHT in the initial request), and Combobox2 will select the starting row and Combobox3 will select the file type.

There is a function in the Code for selecting the Destination Folder ( GetFolder() ) which will be shooting when we press the Split button and will split the sheet into files to the selected folder.

Please see the attached Excel File for reference and advise how can we meet the needful from the code


NB. I couldn't link my user form with a button, so you need to open VBA editor manually


Thanks in Advance



Any Update Please
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1