Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If the word in the previous step matches the word in the current step
#1
If the word found in the previous stage matches the word in the current cell. 

I'd like to ignore the search for words in the current cell and find the mango.

Is there any way?


Function macro1
Code:
Copy      Help
out 
str cell_word; int i nRows
ExcelSheet es.Init; nRows=es.NumRows
for i 2 nRows+1
,es.GetCell(cell_word 2 i)


,web F"https://www.google.com/search?&q={cell_word}"


Attached Files Image(s)
   
#2
Function macro21
Code:
Copy      Help
out
str cell_word; int i nRows
ExcelSheet es.Init; nRows=es.NumRows
str prev_word
for i 2 nRows+1
,es.GetCell(cell_word 2 i)
,if(prev_word = cell_word) continue
,prev_word = cell_word
,web F"https://www.google.com/search?&q={cell_word}"
#3
Thank you for your help Big Grin

I solved all the problems with your help.
#4
This is a more generic way to avoid all duplicated word(s).
Like in this scenario:
Apple
Apple
Mango
Apple
Orange
Apple
Durian
Apple
Pear

Function macro22
Code:
Copy      Help
out
str cell_word; int i nRows
ExcelSheet es.Init; nRows=es.NumRows
str prev_word
ARRAY(str) nodupe
for i 2 nRows+1
,es.GetCell(cell_word 2 i)
,if(sub.isExist(nodupe cell_word)) continue
,nodupe[] = cell_word
,web F"https://www.google.com/search?&q={cell_word}"(`)
,
#sub isExist
function# ARRAY(str)&arr $b
int i
;out F"arr.len = {arr.len}, b = {b}"
out F"{b}"
for i 0 arr.len
,if (arr[i] = b)
,,ret 1
ret 0
#5
Amazing! Perfect!
Thanks to you, I'm very happy to solve the problem.


Forum Jump:


Users browsing this thread: 1 Guest(s)