How can i add to this code to also include the following

December 8, 2014 at 21:06:35
Specs: Windows 7
If cell AH2:AH151 > 0, then returns (" winner?" of The Final Round)
Else (No Winner For The Final Round)
Code:
If Sheet1.Range("I155") = 9 Then
With Range("AI2:AI151")
Set num = .Find(9, lookat:=xlWhole, LookIn:=xlValues)
If Not num Is Nothing Then
firstAddress = num.Address
Do
tempnames = tempnames & Range("C" & num.Row) & "; "
Set num = .FindNext(num)
Loop While Not num Is Nothing And num.Address <> firstAddress
End If
End With
If tempnames <> "" Then
Range("P155") = "- " & Left(tempnames, Len(tempnames) - 2) & " Won The Jackpot For This Round. Jackpot Next Week $15"
Else: Range("P155") = "- No Jackpot Winners For This Round, Jackpot Next Week $" & (Range("O155") + 15)
End If
End If

See More: How can i add to this code to also include the following

Report •


#1
December 10, 2014 at 09:57:53
Please click on following line and read the intructions on how to post VBA code in this forum and then repost your code so that it is easier for us to read. Thanks!

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
December 11, 2014 at 03:03:52
The response to the additional function will be recorded in cell "P155"

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
     If Sheet1.Range("I155") = 9 Then
        With Range("AI2:AI151")
           Set num = .Find(9, lookat:=xlWhole, LookIn:=xlValues)
             If Not num Is Nothing Then
                firstAddress = num.Address
                Do 
                  tempnames = tempnames & Range("C" & num.Row) & "; "
                  Set num = .FindNext(num)
                Loop While Not num Is Nothing And num.Address <>               firstAddress
             End If
        End With
        If tempnames <> "" Then
          Range("P155") = "- " & Left(tempnames, Len(tempnames) - 2) & " Won The Jackpot For This Round. Jackpot Next Week $15"
          Else: Range("P155") = "- No Jackpot Winners For This Round, Jackpot Next Week $" & (Range("O155") + 15)
       End If
  End If
End Sub

message edited by Chrisbucky


Report •

#3
December 12, 2014 at 04:58:11
I have not received a reply to my problem. Is this possibly because i failed to explain the situation satisfactorily enough for you to be able to comprehend what i'm trying to achieve

Report •

Related Solutions

#4
December 12, 2014 at 17:41:42
You may not have received an answer because we are all volunteers and answer questions as time and talents allow.

For example, I am traveling this weekend with no access to a system where I can test your VBA code. Maybe I can look at it early next week.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#5
December 31, 2014 at 23:15:42
Hopefully now that New Year is here the VBA experts may be back.

"I've always been mad, I know I've been mad, like the most of us..." Pink Floyd


Report •


Ask Question