+ Reply to Thread
Results 1 to 15 of 15

Need help connecting multiple data rows to one name

Hybrid View

  1. #1
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,948

    Re: Need help connecting multiple data rows to one name

    Amended code:

    Sub Fill_Grade_Sheets()
    
    Dim ws1 As Worksheet
    Dim ws2 As Worksheet
    
    Dim r As Long
    Dim rr As Long
    Dim ns As Long
    
    Dim Student As String
    
    
    Set ws1 = Worksheets("Grades")
    Set ws2 = Worksheets("Grade Sheets")
    
    r = 2
    rr = 4
    ns = 1
    
    ws1.Activate
    
    With ws1
    
    Do While .Cells(r, 1) <> ""
    
        ' Fiil in a Grade sheet
        '
        rs = (ns - 1) * 25
        Student = .Cells(r, 3)
        
        ws2.Cells(rs + 4, 1) = .Cells(r, 3)
        ws2.Cells(rs + 4, 4) = .Cells(r, 1)
        ws2.Cells(rs + 4, 9) = .Cells(r, 8)
        
        Do While .Cells(r, 3) = Student
        
            ws2.Cells(rs + 7, 2) = .Cells(r, 4)
            ws2.Cells(rs + 8, 2) = .Cells(r, 5)
            ws2.Cells(rs + 9, 2) = .Cells(r, 6)
            
            r = r + 1
            rs = rs + 5
        
        Loop
        
        ns = ns + 1
    
    Loop
    
    End With
    
    ws2.Activate
    
    End Sub
    Attached Files Attached Files

+ 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] Problems connecting multiple If and VLOOKUP statements
    By thomas.lyons in forum Excel General
    Replies: 11
    Last Post: 12-30-2014, 02:02 PM
  2. [SOLVED] Using VBA / Macro to autosort pairs of connecting columns and rows?
    By Stephen2135 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2013, 09:04 PM
  3. [SOLVED] Connecting Multiple If with or
    By ecelaras in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-11-2012, 05:37 AM
  4. connecting multiple cells to new sheet (VLOOKUP?IF?)
    By Gregula in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-18-2006, 03:10 PM
  5. [SOLVED] Connecting multiple worksheets
    By fyon in forum Excel General
    Replies: 1
    Last Post: 01-05-2005, 01:06 AM
  6. [SOLVED] connecting multiple work sheets
    By fyon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2005, 01:06 AM
  7. [SOLVED] connecting multiple worksheets
    By fyon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-05-2005, 12:06 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