Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I wonder if someone can help me out, I am looping through a range o cells using the code below. My question is, when the loop identifies particular cell in the range that doesnt meet the criteria set out i my code, how do I go about identifying the cell and for example shadin the cell and displaying a messagebox to the user? Any help is much appreciated! Ben ---------------------------------------------------------------- Dim myString As Range Dim TrimString As String For Each myString In Range("B2:B10") TrimString = Trim(myString) If Len(TrimString) = 16 Or Len(TrimString) = 10 Then Else MsgBox myString & "incorrect, doesnt equal 16 or 10, pleas enter a correct value:" myString = InputBox("Enter the correct value") End If Next myString MsgBox "finished!" Unload Me End Su -- benjammin ----------------------------------------------------------------------- benjammind's Profile: http://www.excelforum.com/member.php...fo&userid=1821 View this thread: http://www.excelforum.com/showthread.php?threadid=55641 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |