+ Reply to Thread
Results 1 to 6 of 6

Moving cells around for database import

  1. #1
    Registered User
    Join Date
    05-09-2023
    Location
    US
    MS-Off Ver
    Mac 16.72
    Posts
    3

    Moving cells around for database import

    Hello,

    I am a medium-level Excel user. However, I primarily use Excel to prepare data to be imported into a FileMaker database. I have a grade report from my university's reporting system that is in PDF format. I am able to open that PDF in Word, then copy and paste it into Excel and it keeps the formatting consistent. However, the data isn't in a suitable format for FileMaker. I'm pretty bad at script programming in Excel but can tweak an existing script okay.

    The report is a grade report listing all students in my unit in a given semester. It is divided into sections by student. There is a variable amount of rows per student. The only data I need are the Student ID (always a 9-digit number), Section Number (always a 5-digit number), Midterm Grade, and Final Grade. Ideally, a script would search for the first 9-digit number, copy it, and paste it in a separate sheet, go to the first sheet and copy each Section Number, Midterm, and Final Grade for each section and paste it into the second sheet with the Student ID in the first column. Then, do the same thing with the next student.

    All I need is to have rows with the Student ID, Section Number, Midterm Grade, and Final Grade all in a separate sheet. I don't know if I can script looking for data based on field length and paste it before those cells or not. Attached is an example of what the report looks like then on the second sheet, what I need.

    I don't know if this is medium or difficult to do since there is a variable amount of rows per student. Any help is appreciated. Thanks!

    Keith


    example 1.xlsx

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Moving cells around for database import

    Hi saxman and welcome to the forum,

    Going from Filemaker to PDF and then to Excel seems iffy to me. Can't you export the data from Filemaker to Excel directly as a start?
    https://stackoverflow.com/questions/...her%20than.MER.

    The second part of your question depends a lot on what the data looks like. But see:
    https://www.exceldemy.com/split-exce...the%20keyboard.
    to see if any of these methods fit your problem.
    Last edited by MarvinP; 05-09-2023 at 08:45 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-09-2023
    Location
    US
    MS-Off Ver
    Mac 16.72
    Posts
    3

    Re: Moving cells around for database import

    The original data comes from the university database which is proprietary. That's in PDF format. FileMaker is the final destination which is why I need the Student ID on the same row as the Section Number, Midterm, and Final Grade. Thanks!

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Moving cells around for database import

    Hi saxman,

    Because you said "script", I'm assuming you are talking about Power Query.

    If you save your file and then create a Powe Query Script to pull in that file's data is your start.
    Then you need to create a new conditional column that will only copy the ID: if it has one in column 1 into this new column.
    Then the big step is to "Fill Down", which will copy those IDs down until it finds another.
    Filter our all the null and Section in that column and remove all the columns you don't need.

    Here is my work on your file. You will need to save it to your own hard drive and replace the script path to where you saved it.
    Hope this helps.
    ps - there are a lot of ways to get your result using Power Query.
    Student Grades Reduced.xlsx

  5. #5
    Registered User
    Join Date
    05-09-2023
    Location
    US
    MS-Off Ver
    Mac 16.72
    Posts
    3

    Re: Moving cells around for database import

    Hello MarvinP,

    Fantastic! Thanks for your help and pointing me in the right direction. I've never used Power Query before and it seems like the tool I was needing. Thanks!

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Moving cells around for database import

    Greetings to all.
    You can also try the following:

    PHP Code: 
    Sub Macro_8()
    Dim aQ&, i&, R&, b
    Application
    .ScreenUpdating False
    Range("P1"Cells(Rows.Count1).End(xlUp)(2)): UBound(a)
    11
    a
    (R1) = "ID"a(R2) = "Section"a(R3) = "Midterm Grade"a(R4) = "Final Grade"
    Do While Q
      
    Do While a(i9) <> "Section"iLoop
      b 
    Split(a(21), ": ")(1)
      Do
        
    i: If a(i9) = "" Then Exit Do
        
    R
        a
    (R1) = ba(R2) = a(i9): a(R3) = a(i13): a(R4) = a(i15)
      
    Loop
    Loop
    [w1].Resize(R4) = a: [w1].Resize(R4).Columns.AutoFit
    End Sub 
    Attached Files Attached Files
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

+ 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] organizing data from a database import - blank cells
    By burnsie in forum Excel General
    Replies: 3
    Last Post: 09-21-2020, 01:10 PM
  2. Import Access database
    By Diana Carter in forum Excel General
    Replies: 1
    Last Post: 04-26-2019, 09:51 AM
  3. Moving my database in excel to access
    By DavidRoger in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-09-2014, 09:30 AM
  4. Replies: 1
    Last Post: 07-28-2013, 09:19 PM
  5. import data into a database
    By rjhe22 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2013, 11:53 AM
  6. Moving Contact Database
    By SomeoneNamedMichael in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2011, 11:08 PM
  7. vba moving userform to database
    By oreome32278 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2007, 05:45 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