MsgBox Question


Posted by Jim on July 06, 2001 9:59 AM

Excel 2000:
I need to add a button to a MsgBox and write code to it
and reads c23:C28 and convert all 3's to 2's
any thoughts or ideas would be appreciated
Jim

Posted by Russell on July 06, 2001 10:30 AM

You'll have to make a form.

Posted by Joe Was on July 06, 2001 10:39 AM

Find and Replace

Sub myFindReplace()
Range([C28].End(xlUp).Cells(1, 0), [C23]).Replace What:="3", Replacement:="2", LookAt:=xlPart, MatchCase:=False
End Sub

This code will search C23:C28 for any "3" and replace it with "2" hope this helps. JSW



Posted by Jim on July 06, 2001 11:00 AM

Greetings Russell,
This is what i was trying to accomplish in a "MsgBox"
NOT a UserForm:
If [C23] > "2" Then
MsgBox "You Have Entered The Wrong Data", _
vbYesNO + vbQuestion,
If vbNo Then
Range("C23").FormulaR1C1 = "2"
Selection.Font.ColorIndex = 0
End If
End If
End Sub
It works
Jim

You'll have to make a form.