Posts: 151
Threads: 90
Joined: Aug 2014
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
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)
Posts: 117
Threads: 5
Joined: Nov 2015
Function
macro21
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}"
Posts: 151
Threads: 90
Joined: Aug 2014
04-15-2019, 04:02 AM
(This post was last modified: 04-15-2019, 02:36 PM by BK .)
Thank you for your help
I solved all the problems with your help.
Posts: 117
Threads: 5
Joined: Nov 2015
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
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
Posts: 151
Threads: 90
Joined: Aug 2014
Amazing! Perfect!
Thanks to you, I'm very happy to solve the problem.