• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code to import file, Delete, & Edit columns

ToRaDoYa

New Member
i searched everywhere i was not able to find a VBA Code that will do the following


1- ask for a file to import the following columns B, C, D, G, J, O, Q, M to row 3


2- Rearrange the imported columns to be


· O is Column 1

· G is column 2

· J is column 3 – it should be divided ( Step3)

· J is column 4 – it should be empty for now

· J is column 5– it should be empty for now

· C is column 6– it should be divided ( Step 4)

· C is column 7– it should be empty for now

· B is column 8

· D is column 9

· Q is column 10

· M is column 11



3- Dividing column “J”

column “J” should be divided to 3 columns, each dash represent a column


example:


BDDC09YS010010-SFNY 22 Deck-Cellar D Primary Tubular Framing Prefabrication


· “BDDC09YS010010” is column 4

· “SFNY 22 Deck” is column 5

· “Cellar D Primary Tubular Framing Prefabrication” is column 3

· If there is more than 3 dashes the code should ignore them





4- Dividing column “C”

column “C” should be divided to 2 columns, each dash represent a column


example:


SDD-PB2-101


· “SDD-PB2-101” is column 7


· “SDD” is column 6 (it will take the first part only up to the first dash)



I tried to gather several codes together from all over the internet, mixing so many codes did not end up well, I will really appreciate the help, I spent 1 week trying to do this I’m tired
 
Last edited:
i posted this query at Eileen's site, i will be happy to accept any good and easy method in order to solve my query

here is the original MTO file Here

here is the required result here

as u can see i imported 8 columns from the original file, re-arrange them, and then i divided column J to 3 column, then i divided column c to 2 columns by using "Text To columns" Function
 
Back
Top