Posts: 128
Threads: 48
Joined: Jan 2007
Hi there
I'm looking for a macro which extracts the contents of a row from A to W and splits the content in different strings, next time i run the macro is run the next row should be extracted the same way. can this be done?
thx in advance
Freggel
Posts: 11,929
Threads: 138
Joined: Dec 2002
Macro
Macro1456
;/exe 1
ARRAY(str) a
ExcelSheet es.Init
;get selected row index. If selected single column, select A-W.
int r nc
es.GetSelectedRange(0 nc r)
if(nc=1) es.SelectRange(F"A{r}:W{r}")
;get data from selection
es.GetCells(a "sel")
;select next row
r+1
es.SelectRange(F"A{r}:W{r}")
;results
int i
for i 0 a.len(1)
,out a[i 0]
;A in a[0 0], B in a[1 0], C in a[2 0], ...
Posts: 128
Threads: 48
Joined: Jan 2007
thank you helped me alot!
if i may can you help me with another thing? is it possible to give the rows which were extracted a colour? so if a certain area has been done this is marked for example green.
Thanks in advance!
Posts: 11,929
Threads: 138
Joined: Dec 2002
insert after es.GetCells...
;make selected cells green
Excel.Range sr=es.ws.Application.Selection
sr.Interior.ColorIndex = 4
sr.Interior.Pattern = Excel.xlSolid
or
Macro
Excel get row
Acc ac=acc("Fill Color" "DROPLIST" win("" "XLMAIN") "MsoCommandBar" "" 0x1001)
ac.Mouse(1)
The second code does not erase Undo.
Posts: 128
Threads: 48
Joined: Jan 2007
Thank you very much!
can you tell me also how i can paste content in a cell in the row i just colored?
like from a listbox with 3 options in like the 'W' cell ?
Sorry for bothering you so much but thanks for helping me out!
Posts: 11,929
Threads: 138
Joined: Dec 2002
es.SetCell("content" 23 r) ;;23 is for W column
Posts: 128
Threads: 48
Joined: Jan 2007
Hello,
Can someone tell me why this :
sel(list(items "" "test" 800 500 0 0 0x3))
case 1 es3.SetCell("Done" 24 r3)
doesn't work ?
and this:
sel list(items "test")
case 1 es3.SetCell("Done" 24 r3)
Does?
All I want is to place this listbox on a certain area on the screen and have it active, it is placed and active but in the first sample it does not place the 'done' in the excel-cell and in the 2nd sample it does.
I cannot figure out what is wrong...
Posts: 11,929
Threads: 138
Joined: Dec 2002
If you use flag 2 with LIST, items must contain numbers.
Macro
Macro1423
str items="1 a[]2 b"
sel(list(items "" "test" 800 500 0 0 0x3))
,case 1 mes 1
or don't use flag 2
Macro
Macro1423
str items="a[]b"
sel(list(items "" "test" 800 500 0 0 0x1))
,case 1 mes 1
Posts: 128
Threads: 48
Joined: Jan 2007