koden Posted November 5, 2007 Report Share Posted November 5, 2007 I can't find out to do following thing: I run thru a lot of server names. I copy the server name and put it into notepad, copy next server name and put it into notepad a.s.o. But I would like to make a check, so that if the server name already exist in the notepad, then the macro should stop. Because sometimes the clipboard don't get the new server name. Don't know why... I think it would be easyer to do in the macro than comparing with the notepad. I would do it this way: copy server name to T1 and copy the server name to notepad. next copy I would like to compare with T1 before paste into notepad. IF clipboard and T1 is the same, macro should stop. If not macro should paste clipboard to notepad and change T1 to the new value. Do you understand and can i do this??? Quote Link to comment Share on other sites More sharing options...
floyd Posted November 6, 2007 Report Share Posted November 6, 2007 I would do it like this: 1. Start with a blank string 2. Get the next server name 3. Check if server name is in the string yet 4. If it isn't, then append to string and add to notepad 5. Loop to 2. Because sometimes the clipboard don't get the new server name. Don't know why...Probably need to add a delay after copying it to the clipboard. Quote Link to comment Share on other sites More sharing options...
koden Posted November 7, 2007 Author Report Share Posted November 7, 2007 Thanks...and sorry that I have not informed about that i have found a solution. LOOP: I copy servername to T2 IF variable T2=T1 then the macro should stop. else copy server name to T1 text type T1 into notepad. It works but I can se it's easier your way... i think ??? Quote Link to comment Share on other sites More sharing options...
terrypin Posted November 7, 2007 Report Share Posted November 7, 2007 Thanks...and sorry that I have not informed about that i have found a solution.LOOP: I copy servername to T2 IF variable T2=T1 then the macro should stop. else copy server name to T1 text type T1 into notepad. It works but I can se it's easier your way... i think ??? I wouldn't have thought your method would work. Unless I've misunderstood, surely it would only compare two successive names? I thought you wanted to compare each new name with all the previous ones? Or are you saying they are all in some sort of order, and duplicates only occur together? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
koden Posted November 7, 2007 Author Report Share Posted November 7, 2007 I think you have misunderstood. but what the... :-) my english is'nt the best, so no wonder why :-) The problem was that I have a list with server names. I copy one name and set it into notepad. But sometimes the clipboard did not copy the name and the old name was in the clipboard. Then there would be 2 names of the same in notepad. Så what i needed was just to check that the clipboard did'nt still have the old servername. :-) Quote Link to comment Share on other sites More sharing options...
terrypin Posted November 7, 2007 Report Share Posted November 7, 2007 OK, thanks, understood. Glad you got it sorted. -- Terry, East Grinstead, UK 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.