Hi thanks for looking at my post.
I'm new to vba programming in excel and am hitting an issue when trying to find a specific row within a sheet and deleting the row.
What I am looking to achieve is to look in the data list and remove the row with "NO WINNER" in. I look in box A3 if 'no winner' is there then that's fine and I'm happy for the thing to progress with the other macros that I have built. However, if A3 does not contain 'NO WINNER' then i need to look in the list which could have 2000 entries and delete that entry/row. This is a bit of polish on a nice tool I have built but it's driving me mad because on my main machine the below works fine but on the machines I'm distributing this on I get a 91 error which is doing my head in and I can't fix it.
I was wondering if there is a neater way for me to achieve my objective which is to find the row with 'NO WINNER' in and remove it.
Any gurus out there who can help a newbie!
Here's my current code
Sub Findnowinner()
'
' Findnowinner Macro
' Looks to see if A3 is now winner if NO then Find no winner and remove ....put this before print ticket for audit
'
Dim Name As String
Name = Sheets("Payout Calc and Print").Range("A3").Value
If Name = "NO WINNER" Then Exit Sub
If Name <> "NO WINNER" Then Call Delnowin
Lastline:
End Sub
Sub Delnowin()
Dim uRange As Range
Dim FindTitle As Range
Dim tRow As Integer
Dim tCol As Integer
Set uRange = ActiveSheet.UsedRange
Set FindTitle = uRange.Find("NO WINNER")
tRow = FindTitle.Row
Rows(tRow & ":" & tRow).Select
Selection.ClearContents
End Sub
Bookmarks