| View previous topic :: View next topic |
| Author |
Message |
Oli00
Joined: 22 May 2006 Posts: 25
|
Posted: Fri Sep 15, 2006 12:56 pm Post subject: If {Excel field = nothing} |
|
|
Hello,
anybody has an idea why this doen't work?
| Code: | loop
{
clipboard =
a = xīrīn
b =
send, ^{down}
send, ^c
clipwait, 3
if clipboard = %a%
{
send, ^{up}
send, {down}
break
}
else if clipboard = %b%
{
send, ^{up}
send, ^{up}
send, {down}
break
}
}
return |
AHK doesn't recognize when it finds a empty cell!
Thanks a lot
Oli |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1249 Location: USA
|
Posted: Fri Sep 15, 2006 1:51 pm Post subject: |
|
|
I use this snippet to test cells in one of my scripts, It will have to be modif ied...
| Code: | ClipBoard := ;
SendInput, {CTRLDOWN}c{CTRLUP}
ClipWait
Var2 := Clipboard
SendInput, {ESC}
StringSplit, Var2_, Var2, `n, %A_Space% %A_Tab% `n
Length := StrLen(Var2_1)
IfLessOrEqual, Length, 2
{
; Selected Cell is blank (except for [b]`n[/b]) (in my situation)
; So do stuff
}
Else
{
; Not blank, Do other Stuff
} |
|
|
| Back to top |
|
 |
Peter
Joined: 30 Dec 2005 Posts: 279
|
Posted: Fri Sep 15, 2006 6:05 pm Post subject: |
|
|
I guess you use variable b for checking on an empty cell? No, that doesn't work . An empty cell contains either `n or `r, or both (I'm not sure what, but it's not an empty string). |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1249 Location: USA
|
Posted: Fri Sep 15, 2006 6:32 pm Post subject: |
|
|
| Quote: | | Code: | IfLessOrEqual, Length, 2
{
; Selected Cell is blank (except for `n) (in my situation) | |
|
|
| Back to top |
|
 |
Peter
Joined: 30 Dec 2005 Posts: 279
|
Posted: Fri Sep 15, 2006 8:50 pm Post subject: |
|
|
@ahklerner: Sorry, you are right. I just quickly looked at the post, but you gave the solution in your post already  |
|
| Back to top |
|
 |
hd0202
Joined: 13 Aug 2006 Posts: 59 Location: Germany
|
Posted: Sat Sep 16, 2006 5:07 am Post subject: |
|
|
Hello
for my test with Excel 2003 I changed:
and then it works (look for the red color in both lines)
Hubert |
|
| Back to top |
|
 |
Glurp Guest
|
Posted: Sat Sep 16, 2006 8:34 am Post subject: |
|
|
| Probably it was more a clipboard problem than an Excel one, as each text line in the clipboard ends with `r`n, which is not necessary the case for excel (I'm quite sure it isn't). |
|
| Back to top |
|
 |
Oli00
Joined: 22 May 2006 Posts: 25
|
Posted: Mon Sep 18, 2006 8:53 am Post subject: Thatīs it! |
|
|
Thanks a lot!
The Problem was that I used the "`" in the wrong way!
Regards
Oli |
|
| Back to top |
|
 |
|