+ Reply to Thread
Results 1 to 6 of 6

Copy data from master to other sheets

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Copy data from master to other sheets

    Hello all,

    On first sheet Quiz results sheet i will be inserting results and in column A i will pick from dropdown a choice of quiz tables 1-4.
    see attached for examples.
    I was hoping to copy the results from quiz results sheet to appropriate Tables sheet from the choice in column A.

    I hope this is clear enough to understand.Thanks for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Copy data from master to other sheets

    Hi mdshotgun
    if vba is ok then
    Option Explicit
    Sub ptest()
        Dim xcell As Range
        With Sheets("Quiz results")
            For Each xcell In .Range("A3", .Cells(Rows.Count, 1).End(xlUp))
                xcell.Resize(1, 6).Copy Destination:=Sheets(xcell.Text).Cells(Rows.Count, "B").End(xlUp).Offset(1, 0)
            Next
        End With
    End Sub
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Copy data from master to other sheets

    Thank you Pike for your reply,

    Yes it works nicely.
    But i have 1 last small issue.
    every week we will be adding the next set of quiz fixtures.
    Ex:I add next weeks fixture to row 15 and when i add in results and run the program,
    it seems to be copying all results again,not just the new ones.
    If this can't be fixed easy,i can just clear all the previous weeks results first,but
    it was something i hope i did'nt have to do.

    But thanks very much for your help.

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Copy data from master to other sheets

    hi mdshotgun
    One way wouid be to count all the rows with values in all the Quiz table sheets then start from that row number in the result table.
    But why not just delete the last record as you have re-distribted the result to the sheet.

  5. #5
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Copy data from master to other sheets

    Hi Pike,

    I was keeping the results on quiz results sheet,so when i was posting up next weeks fixtures
    that i could remember what teams already played who.
    And i know they are on quiz tables sheets
    But it was easier to leave them on quiz results sheet so i would'nt have to keep track of each other sheet.

    I will try your suggestion first.Thanks Pike.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Copy data from master to other sheets

    mdshotgun
    another way would be to count the rows in the result sheet on opening or activate then before close or deactivate the sheet it runs the code from the last row to new rows

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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