AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

If {Excel field = nothing}

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Oli00



Joined: 22 May 2006
Posts: 25

PostPosted: Fri Sep 15, 2006 12:56 pm    Post subject: If {Excel field = nothing} Reply with quote

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
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Fri Sep 15, 2006 1:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Peter



Joined: 30 Dec 2005
Posts: 279

PostPosted: Fri Sep 15, 2006 6:05 pm    Post subject: Reply with quote

I guess you use variable b for checking on an empty cell? No, that doesn't work Cool . 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
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Fri Sep 15, 2006 6:32 pm    Post subject: Reply with quote

Quote:
Code:
IfLessOrEqual, Length, 2
 {
 ; Selected Cell is blank (except for `n) (in my situation)
Back to top
View user's profile Send private message
Peter



Joined: 30 Dec 2005
Posts: 279

PostPosted: Fri Sep 15, 2006 8:50 pm    Post subject: Reply with quote

@ahklerner: Sorry, you are right. I just quickly looked at the post, but you gave the solution in your post already Smile
Back to top
View user's profile Send private message
hd0202



Joined: 13 Aug 2006
Posts: 59
Location: Germany

PostPosted: Sat Sep 16, 2006 5:07 am    Post subject: Reply with quote

Hello

for my test with Excel 2003 I changed:

Code:

a = x`r`n
b = `r`n


and then it works (look for the red color in both lines)

Hubert
Back to top
View user's profile Send private message
Glurp
Guest





PostPosted: Sat Sep 16, 2006 8:34 am    Post subject: Reply with quote

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

PostPosted: Mon Sep 18, 2006 8:53 am    Post subject: Thatīs it! Reply with quote

Thanks a lot!

The Problem was that I used the "`" in the wrong way!

Regards

Oli
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group