terrydiz Posted May 24, 2005 Report Share Posted May 24, 2005 I work with a program (OC:WebConnect) where I frequently copy and paste data from an Excel list directly into the OC:WebConnect screen. It works fine, but has many of the same qualities of a DOS program. I am no coder (at all), but I have ME doing about 95% of the things I want. However, I have a particular macro that copies and pastes two items (one at a time) and returns an answer. When a particular word (PAID) pops up on screen after the first item is pasted, I want the macro to stop. Otherwise, the macro grabs the next piece of data and copies it to the wrong place and I have some additional typing to do. The word "Paid" pops up in a particular area of the screen that does not populate if the macro should go farther. I tried to copy the text "Paid" to my clipboard and then doing a "If clipboard contains..." macro, but it doesn't seem to work. I placed the "End If" item directly after that macro, but the macro never stopped. Where have I erred? Thanks, Terry Dismore Lazarus Communications Group Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 24, 2005 Report Share Posted May 24, 2005 can you paste the code you are using so we can look at it? Quote Link to comment Share on other sites More sharing options...
kevin Posted May 24, 2005 Report Share Posted May 24, 2005 The End If terminates an If block like this: If Variable %T1% does not contain "DONE" // <Do some // macro commands // here> End If To terminate a macro from within an If block you need to use either the Macro Return or the Macro Stop. Maybe something like this would work: If Variable %T1% does not contain "PAID" // <Do some // macro commands // here> Else Macro Return End If Quote Link to comment Share on other sites More sharing options...
terrydiz Posted May 24, 2005 Author Report Share Posted May 24, 2005 Cyberchief and Kevin; Thanks for the help. What I didn't understand was that "End If" was a statement that ended the "If" branch (remember, I said I was no coder!). I thought that if the variable that I entered matched the "If" statement, it was meant to "end" the macro. Your help was invaluable and I have sucessfully built a working macro for this process. Thanks, In His Grip, Diz Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.