+ Reply to Thread
Results 1 to 6 of 6

VBA, search and return a message

Hybrid View

hluk VBA, search and return a... 07-11-2008, 03:42 PM
VBA Noob Maybe Sub FindPhrase()... 07-11-2008, 03:54 PM
hluk THANK YOU! I want to add... 07-14-2008, 12:44 PM
VBA Noob It use in a loop. 0 to Ubound... 07-14-2008, 01:14 PM
hluk Thanks for the prompt reply. ... 07-14-2008, 01:27 PM
VBA Noob Arr = Array("N o r m a l t... 07-14-2008, 01:32 PM
  1. #1
    Registered User
    Join Date
    07-09-2008
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    91
    Thanks for the prompt reply. I tried to add a 3rd condition to the script and it didn't turn out too well.

    So, from what I understand, the for loop tries to find the Arr(0) first. Then if Rng isn't empty, it will put value into cell B4. Then it tries Arr(1). However, now I need a third condition, a case where both "normal termination" and "error termination" aren't found.

    Is this what I should add? If so, where should I add this?
    PHP Code: 
    Else
                .
    Range("B4").Value "This analysis was not completed/ interrupted.  Please rerun or discard." 

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Arr = Array("N o r m a l    t e r m i n a t i o n", "E r r o r   t e r m i n a t i o n")
    The i statement loops throught the two conditions above (0 = Normal and 1= Error). If it finds both it will accept the last one.

    If none found I would use the Else statement for that.

    As you are finding out you need to spend more time thinking about all the options before posting a question

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1