Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Output list based on value in a cell
I hope someone here can help. I have next-to-zero experience with
Excel macros. I have a large spreadsheet that was used to track workshop attendance for several people throughout 2005. It has names in Column A and workshop names in Row 2. Throughout the year, if someone attended a workshop, a number was placed next to their name under the workshop, representing the number of hours they attended. Now I need to somehow output to a list each persons name, ONLY the workshops they attended, and their total hours attended. For example: If F5 contains a value, I need to output A5, F2, F5 (that is, Name, Workshop Name, Hours attended.) Is this possible in Excel? Something you could walk a macro newbie thorough? Thanks in advance for any help you can provide. Brett |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Output list based on value in a cell
Hi Brett,
I have created this macro that does the trick In short: It creates a new sheet where the result will come It places headings on this new sheet. It walks throu you sheet and copies the - name - workshop - hours to the new sheet. Public Sub TotalsPerAttendee() Dim lRowScan As Long Dim lColScan As Long Dim lRowReport As Long Dim sCurrent As String ' sCurrent = ActiveSheet.Name ThisWorkbook.Sheets.Add ActiveSheet.Name = "AttendeeReport" Range("A1").Value = "Name" Range("B1").Value = "WorkShop" Range("C1").Value = "Hours" lRowReport = 2 Sheets(sCurrent).Activate lRowScan = 3 Do lColScan = 2 Do If Not IsEmpty(Cells(lRowScan, lColScan)) Then Sheets("AttendeeReport").Cells(lRowReport, 1) = Cells(lRowScan, 1) Sheets("AttendeeReport").Cells(lRowReport, 2) = Cells(2, lColScan) Sheets("AttendeeReport").Cells(lRowReport, 3) = Cells(lRowScan, lColScan) lRowReport = lRowReport + 1 End If lColScan = lColScan + 1 Loop Until IsEmpty(Cells(2, lColScan)) lRowScan = lRowScan + 1 Loop Until IsEmpty(Cells(lRowScan, 1)) End Sub Hoop this helps Executor. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Output list based on value in a cell
Thank you!
Worked like a charm! Brett |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Validation based on output of a different cell. | Excel Discussion (Misc queries) | |||
Output client name based on date... | Excel Worksheet Functions | |||
output based on data in a graph | Excel Worksheet Functions | |||
Ooh .. Linking a list to a list to an output cell | Excel Discussion (Misc queries) | |||
Add value to array based on if...then output in VBA | Excel Programming |