+ Reply to Thread
Results 1 to 11 of 11

Macro assistance needed for complex export/import excel file

  1. #1
    Registered User
    Join Date
    02-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Question Macro assistance needed for complex export/import excel file

    I am currently exporting a file from my database, then manually filtering and replacing things. I am still working on building my knowledge base on how to use VBA and Macros and I know i have a long way to go.

    I am uploading a sample document that has three workbooks. Workbook 1 is how it looks when its finished and ready for uploading. Workbook 2 is the data i get from my SIS database, and workbook 3 is an empty template.

    I know can bring over columns A,B,C,D, and E on Workbook 1 without a problem as those are static fields that never change. The hard part (for me) is filling in G, I, J, K, M, N based on the value of WorkBook 2's Column G.

    I Assume that I need to do an If G contains "Rad HR2" then ... statement for these?

    Any assistance with furthering my knowledge will be appreciated

    Thank you

    Don.
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro assistance needed for complex export/import excel file

    Don

    I dont see where your getting the values for columns G, I, J, K, M, N so below code will find the rows for you. Maybe this will help

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    02-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro assistance needed for complex export/import excel file

    Thats the problem when you spend soo much time in these excel documents. you forget that no one else can peak into your brain

    I have created a new tab called "The Mystery of G" with colomn A being the value of the export file and GIJKMN with the associated values.

    Thank you for any assistance

    Don.
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro assistance needed for complex export/import excel file

    Will all this data be in 1 workbook? Or are these 3 different workbook?

  5. #5
    Registered User
    Join Date
    02-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Thumbs up Re: Macro assistance needed for complex export/import excel file

    Quote Originally Posted by mike7952 View Post
    Will all this data be in 1 workbook? Or are these 3 different workbook?
    Yes all goes into Work Book 1. The data pulls from the workbook titled nwea export for upload), and the other two (Mystery of G, Empty Template) are my visual references

    Thank you

    Don.

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro assistance needed for complex export/import excel file

    Ok, can you explan to me the exact process. Im confussed as to where The Mystery of G comes in. Are we to loop down worksheet NWEA_Export_for_Upload column G, an only look for rows that contain Rad HR 2. After that im lost as to how you match up to the mystery sheet?

  7. #7
    Registered User
    Join Date
    02-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro assistance needed for complex export/import excel file

    This is the correct one.xlsxThank you for your assistance with this

    I reorganized the workbooks a bit to make since.

    The first Workbook is titled "Output Template" All the data needs to be deposited there.
    WorkBook 4 is an example of how the "output template" is populated.

    WorkBook 2 "NWEA_Export_For_Upload" is the raw data I download from my SIS database.

    G Column NWEA is an explanation of what happens to Column G in Workbook 2 (NWEA Export) and how it populates into the "Output Template"

    So it should go like this:

    If NWEA_Export_for_Upload Column G Cell "x" contains "Variable" then output to Column GIJKMN on Output template.

    Thank you

    Don.
    Attachment 217229
    Last edited by dedavie; 02-27-2013 at 07:07 PM.

  8. #8
    Registered User
    Join Date
    02-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro assistance needed for complex export/import excel file

    Hmm last upload was the wrong file.

    here is this one. This is the correct one.xlsx

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro assistance needed for complex export/import excel file

    See attatched workbook.

    Click the button on the G Column NWEA sheet. Right now columns A thru E are not being populated because I dont know where your getting those values? I know they will be the same for all data added to output. Im also guessing that the values in column on G Column NWEA sheet will be unique.
    Attached Files Attached Files
    Last edited by mike7952; 02-27-2013 at 09:00 PM.

  10. #10
    Registered User
    Join Date
    02-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Thumbs up Re: Macro assistance needed for complex export/import excel file



    You are awesome!! Thank you! The Macro worked perfectly, I was able to enter the two columns i needed and transfer it to the CSV and it uploaded seamlessly. AND it found three errors that the past manual input file had!

    THANK YOU!!!!

    Don.

  11. #11
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Macro assistance needed for complex export/import excel file

    Don,

    Thanks for the Rep! I dont how you getting the values for coluns A to E. I know there the same. But heres how you would add them below in red.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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