Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Output list based on value in a cell

Thank you!

Worked like a charm!

Brett

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation based on output of a different cell. cdb Excel Discussion (Misc queries) 4 March 23rd 07 07:37 PM
Output client name based on date... Ted McCastlain Excel Worksheet Functions 0 September 5th 06 09:15 PM
output based on data in a graph Patrick C. Excel Worksheet Functions 1 September 15th 05 04:49 PM
Ooh .. Linking a list to a list to an output cell StrawDog Excel Discussion (Misc queries) 4 August 22nd 05 09:51 PM
Add value to array based on if...then output in VBA Scott P Excel Programming 4 June 14th 04 11:10 AM


All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"