lior03
07-05-2005, 07:22 AM
hello
through the outdent button i can alighn macro text
rightward.
my question- how can i squeeze text and get rid of
empty space in the middle of a code.
example:
Sub MSFindIt()
Dim cell As Range, FirstAddress As String
Dim x As String
x = InputBox("what to find")
With Range("A1:C500")
Set cell = .Find(x, LookIn:=xlValues, searchorder:=xlByRows, _
LookAt:=xlPart, MatchCase:=True)
On Error GoTo Finish '<< the "error" being that there are no "it"s
FirstAddress = cell.Address '<< bookmark the start-point of the search
Do
'do whatever you want below, the messagebox is an example...
MsgBox "a matching was found at " & cell.Address
Set cell = .FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstAddress
End With
Finish:
End Sub
thanks
through the outdent button i can alighn macro text
rightward.
my question- how can i squeeze text and get rid of
empty space in the middle of a code.
example:
Sub MSFindIt()
Dim cell As Range, FirstAddress As String
Dim x As String
x = InputBox("what to find")
With Range("A1:C500")
Set cell = .Find(x, LookIn:=xlValues, searchorder:=xlByRows, _
LookAt:=xlPart, MatchCase:=True)
On Error GoTo Finish '<< the "error" being that there are no "it"s
FirstAddress = cell.Address '<< bookmark the start-point of the search
Do
'do whatever you want below, the messagebox is an example...
MsgBox "a matching was found at " & cell.Address
Set cell = .FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstAddress
End With
Finish:
End Sub
thanks