Figured it out
Figured it out
Last edited by JCarollo765; 04-29-2014 at 02:40 PM.
Change cell A6 in the attached Dropdown sheet.
**Even if you figured it out, its useful to keep the question up for other people's knowledge**
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A6")) Is Nothing Then Dim k As Integer 'Dropdown columns... Dim amt As Long 'Amount of premium... Dim n1 As String 'Name of person... Dim cell As Range 'Cell in rng... Dim rng As Range 'Range of people to loop through on Sheet1... n1 = [A6] k = 2 Set rng = Sheet1.Range("A3:A1000") Range("B5:Z6").ClearContents 'Clear prior data... For Each cell In rng If n1 = cell.Value Then For i = 3 To 20 'Number of columns in Sheet1... amt = Sheet1.Cells(cell.Row, i).Value If amt > 0 Then 'If greater than ZERO... print out Cells(5, k).Value = Sheet1.Cells(1, i).Value 'Name of premium... Cells(6, k).Value = Sheet1.Cells(cell.Row, i).Value 'Value... k = k + 1 End If Next i End If Next cell End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks