PDA

View Full Version : Sleeper: Moving upward



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

Norie
07-05-2005, 08:05 AM
What do you mean?

What empty space do you mean?

lior03
07-05-2005, 08:17 AM
hello
i meant the gaps between the paragraphs

Scottie P
07-05-2005, 08:35 AM
Do you mean the empty lines (white space) between code lines?

To make this:



Sub MyCode()
do something

then do something else

End Sub


Look like this:



Sub MyCode()
do something
then do something else
End Sub


Or did I really miss the point?