Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Two workbooks (minipops_quiz.xls and LOGOQUIZ.xls) reached this office this
afternoon and occupied almost everyone's attention until I came up with the following: To show all correct answers, paste the following code into the respective workbook's Sheet1 class. What to do next is left as an exercise for the reader. For minipops_quiz.xls --------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim nRow As Long, nCol As Long For nRow = 6 To 82 Step 4 For nCol = 2 To 6 Worksheets("minipops").Cells(nRow, nCol) = _ Worksheets("answers").Cells(nRow, nCol) Next nCol Next nRow End Sub For LOGOQUIZ.xls ---------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim nSheet As Long, nRow As Long, nCol As Long, i As Long i = 0 For nSheet = 3 To 7 For nRow = 8 To 26 Step 9 For nCol = 2 To 16 Step 2 i = i + 1 Worksheets(nSheet).Cells(nRow, nCol) = _ Worksheets("answers").Cells(i, 2) Next nCol Next nRow Next nSheet End Sub -- Michael Bednarek, Brisbane, Australia http://mcmbednarek.tripod.com/ "POST NO BILLS" |