TAPS_MikeDion
Well-known Member
- Joined
- Aug 14, 2009
- Messages
- 622
- Office Version
- 2011
- Platform
- MacOS
Hello everybody,
This code does work, but I'm betting it can be shortened to be faster and more efficient since I'm not that well versed in VBA coding. Would anyone be willing to help me with that?
I greatly appreciate any help given. If the spreadsheets will be needed to "recreate" the code, I'll have to post them with bugus data tomorrow.
Thank you!
This code does work, but I'm betting it can be shortened to be faster and more efficient since I'm not that well versed in VBA coding. Would anyone be willing to help me with that?
I greatly appreciate any help given. If the spreadsheets will be needed to "recreate" the code, I'll have to post them with bugus data tomorrow.
Thank you!
VBA Code:
With Sheets("Division Member Info")
.Range("AJ3:AO500").ClearContents
For Each c In .Range("D3", .Range("D" & Rows.Count).End(3))
For Each sh In Sheets
If UCase(Left(sh.Name, 2)) = "D-" Then
IDr = sh.Cells(Rows.Count, 7).End(xlUp).Row
'Get last row with an ID number
If IDr > 1 Then
'There is at least 1 ID number
For n = 2 To IDr
'Loop through ID numbers
If c = sh.Range("G" & n) Then
'Matching ID number found
Dn = sh.Range("A" & n).Value
'Dn is assigned the value of the Detail / Event # in column A of the DMI sheet
Select Case Dn
'Place an X in the appropriate Detail / Event # row for the matching ID in the DMI sheet
Case 1
'Road Race
.Range("AJ" & c.Row).Value = "X"
Case 2
'Parade
.Range("AK" & c.Row).Value = "X"
Case 3
'Fireworks
.Range("AL" & c.Row).Value = "X"
Case 4
'Fiestas Patronales
.Range("AM" & c.Row).Value = "X"
Case 5
'Celebrate Holyoke
.Range("AN" & c.Row).Value = "X"
Case 6
'Tree Lighting
.Range("AO" & c.Row).Value = "X"""
End Select
End If
Next
End If
End If
Next
Next
End With