• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Manually Revising Cells In UserForm TextBox Fields?

I was looking to check if any one word in a group of words exists in range, and then manually revise each of them one by one in a userform pop up box. I know how to structure the buttons to "skip" and "enter" whatever changes the user makes in the text box fields -back to the worksheet, I'm just not sure how to make sure this code works so that it runs through each of the found specified words to manually revise if necessary.


Also, I thought it would be a good idea to count the total number of specified words and add them to a "this many remaining" counter on the userform.


Beneath is simply a non-working example:


Sub Check_If_Specified_Words_Exist_And_Count_How_Many()

Application.ScreenUpdating = False

''''''''''''''''''''''''''''''''''''''

Dim C As Range

Dim SpecifiedWords As String

''''''''''''''''''''''''''''''''''''''

Set MyRange = Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)

For Each Cell In MyRange


SpecifiedWords = "Raphael___Leonardo___Michelangelo___Donatello___Casey Jones___April O'Neil"


If C Like SpecifiedWords Then

C.Value = UserForm_ManualRevise_TextBox1.Text

Application.WorksheetFunction.CountIf(MyRange, SpecifiedWords) = UserForm_Revision_Needed_Remaining_TextBox3.Text

End If


For i = 1 To Len(SpecifiedWords)


Next i


Next C

''''''''''''''''''''''''''''''''''''''

Application.ScreenUpdating = True

End Sub
 
Ignoring everything above, I found every answer I was looking for.


I got it to work, and it searches for each found word and closes the userform after the last.


Excel does this automatically. I thought I would have to tell it to do that.


I guess that's what "For Each Cell" means. : )


Resolved.
 
Back
Top