Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Do Until (XP; SR 2)

    I am having a challenge with the following code:

    The code should continue to run until the ActiveCell = 0 and ActiveCell -10 is not blank.

    Do Until ActiveCell.Offset(0,0) = 0 And ActiveCell.Offset(0,-10) <> " "

    'Run some code

    Loop


    The challenge that I am having is that the ActiveCell -10 has text in it (therefore not blank) but the code stops running because it thinks the condition has been met.

    Thanks for taking a look at this,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Do Until (XP; SR 2)

    Use "" instead of " "

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Do Until (XP; SR 2)

    Hans,

    I am not familiar with how to use "instead of" with in the code.

    Would you kindly provide an example.

    Thanks,
    John

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Do Until (XP; SR 2)

    > I am not familiar with how to use "instead of" with in the code.

    Hans meant that you should use a pair of quotes with nothing in between them (""), rather than using a pair of quotes with a space between them (" ").

    Instead of was part of the lounge conversation, not part of the VBA code

    StuartR

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Do Until (XP; SR 2)

    Stuart,

    Okay, now I feel really silly. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Thanks,
    John

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Do Until (XP; SR 2)

    I apologize, I was pressed for time when I posted my reply, so it was shorter than it should have been, causing unnecessary confusion.

Posting Permissions

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