Consulting

Results 1 to 4 of 4

Thread: Sleeper: Moving upward

  1. #1
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location

    Sleeper: Moving upward

    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
    moshe

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    What do you mean?

    What empty space do you mean?

  3. #3
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location

    moving upward

    hello
    i meant the gaps between the paragraphs
    moshe

  4. #4
    Just A Dude VBAX Tutor Scottie P's Avatar
    Joined
    May 2004
    Location
    Remote from 18901 USA
    Posts
    263
    Location
    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?
    Life is Visual: Presence is Perception...
    How we see the world is how we respond to it. ~* Peace *~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •