Newbie help =)

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
tingen
Newbie
Posts: 7
Joined: Thu Jul 01, 2010 11:58 am

Newbie help =)

Post by tingen » Thu Jul 01, 2010 12:07 pm

This is the code, i need it to react to initials 2-3 characters, when it encounters etc. "HL" or "FTE" it need to Press Enter (Skip the line)
(Using the code to refresh cells in microsoft excel)


SetFocus>Microsoft Excel - Ugerapport*
Wait>0.5
Let>t1=1
Let>x=1
Label>loop1
Let>t2=1
Label>loop2
Press F2
Press Tab
Let>t2={%t2%+1}
If>%t2%loop2
EndIf
Press Enter
Press Home
Press Ctrl
Send>ccc
Release Ctrl
Wait>0.1
GetClipBoard>checkvalue
Press Esc
Length>%checkvalue%,clen
If>%clen%>5
MidStr>%checkvalue%,1,5,newcheck
Else
Let>newcheck=%checkvalue%
EndIf
If>%newcheck%=I alt
Press F2
Press Tab
Press Enter
Press Home
Let>x=x+1
EndIf
If>%x%loop1
EndIf

Any help is appreciated.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Jul 01, 2010 2:09 pm

when it encounters etc. "HL" or "FTE" it need to Press Enter (Skip the line)

Code: Select all

GetClipBoard>checkvalue
MidStr>%checkvalue%,1,3,newcheck
//when it encounters etc. "HL" or "FTE" it need to Press Enter (Skip the line)
If>{ (Pos("HL",%newcheck%)=1) OR (%newcheck%="FTE") }
   Press Enter
Endif

tingen
Newbie
Posts: 7
Joined: Thu Jul 01, 2010 11:58 am

Post by tingen » Fri Jul 02, 2010 6:59 am

Thanks for the quick reply, but i does not work like i wanted it to.
Dont know if im pasting it in the wrong place in the code ?
(Looks like it's still refreshing the excel line[A18:K18], when it encounters initials)
- Let me know if you want more info, or screenshots or whatever =) Im happy to help all i can.

Hope u reply.

Bonus question ^_-
I need it to react to about 7 initials etc. "RD" "FK" "SUS" "MS" "SJ"

tingen
Newbie
Posts: 7
Joined: Thu Jul 01, 2010 11:58 am

Post by tingen » Fri Jul 02, 2010 7:44 am

Thanks for the quick reply, but i does not work like i wanted it to.
Dont know if im pasting it in the wrong place in the code ?
(Looks like it's still refreshing the excel line[A18:K18], when it encounters initials)
- Let me know if you want more info, or screenshots or whatever =) Im happy to help all i can.

Hope u reply.

Bonus question ^_-
I need it to react to about 7 initials etc. "RD" "FK" "SUS" "MS" "SJ"
Can i just paste em in like :
If>{ (Pos("RD",%newcheck%)=2) OR (%newcheck%="FK") OR (%newcheck%="MS") OR (%newcheck%="SUS") }
Press Enter


- Sorry to spam the forum hehe, but i just found out, that the script works fine, i just need to add more initials.
Also just realized that it does press enter, but keep on refreshing the whole excel line [A18:K18], I dont know if you can bypass the original loop, because it casuses the script to refresh it all.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts