• 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.

Macro to pull data from 2 workbooks over to 4 workbooks

ILrostering

New Member
Our company receives two .csv files from customers. We are in need of a macro(s) to pull the data from those two workbooks and put it in the correct columns to create four separate workbooks that we use to import data into our systems. Each of the four workbooks we use have specific column headers that have to remain in their particular columns in order for our programs to read them properly. Any help with this would be greatly appreciated! I have attached the 2 files (Templates) we receive from our customers and the 3 of 4 files we need the data transferred into, unfortunately we can only post 5 files on this thread. I would be more than happy to answer any questions if someone is willing to help with this. Thank you!
 

Attachments

  • Robotify Educator Template.csv
    100 bytes · Views: 3
  • Robotify Student Template.csv
    91 bytes · Views: 2
  • Sections.csv
    58 bytes · Views: 3
  • Students.csv
    56 bytes · Views: 1
  • Teachers.csv
    56 bytes · Views: 1
This doesn't sound too complicated. Do you already know something about writing a VBA program? Because I can coach you, if you're willing to learn.
 
Ok, let's start by planning a little. You're going to write a program that works like this, I take it: a) Opens the two input CSVs, b) opens the first output XLSX, writes the contents of the CSVs where needed, and saves and closes the XLSX, c), d), e) does the same to the other three XLSXs one at a time, f) closes the two CSVs and g) displays a message saying that it's done. Does that sound right? If I've misunderstood what you need, this is the place to correct me.

If it looks right, then we'll create a new .xlsm workbook (or start working with the one you're already created), and start a program in it that finds and opens the CSVs. Do you already know how to do that? What does your program look like so far, as far as you've written?
 
I looked at this program this morning, and if I understand it correctly, it doesn't do what you said you wanted. Convert gets the operator to select a folder, then reads all the .csv files and saves them again in .xlsx format. What you asked for, above—I'll name it "Copy2"—is a program that to copy data from two CSVs into four workbooks.

So did you accidentally send me the wrong program (Convert instead of Copy2)? Or is Copy2 going to be an all-new program, and you're not sure where to start?
 
Sorry for the delay; I've had a couple of busy days. So have you made a start on this program (not the one you named "Convert")? How far have you gotten? I can help you fix your program, but I don't want to just write it for you.
 
Back
Top