Sign in to follow this  
Followers 0
Kiti

2D Array

5 posts in this topic

Share this post


Link to post
Share on other sites



look up

UBound()

its basically the same thing

Share this post


Link to post
Share on other sites

look up

UBound()

its basically the same thing

Hmm... so, how can I make this code correct, to replace the last "Blocks of data" with my msg?

#include <ExcelCOM_UDF.au3>
Local $oExcel = _ExcelBookNew(1)

For $i = 1 to 5
_ExcelWriteCell($oExcel, "Blocks of data", $i, 1)
Next

$Find = _ExcelFindInRange($oExcel, "Blocks of data", 1, 1, 5, 1, 0, 2, False, "")
$lastcell = Ubound($Find, x); what's "x"? what to put here?
_ExcelWriteCell($oExcel, "This is the 5th result", $lastcell[3], $lastcell[4]) ; is this good?

Thanks for your help!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ive never really used any of the excel functions so I dont know anything about them but

$Rows = UBound($Find,1);Gives the number of rows in the Array
$Columns = UBound($Find,2);Gives the number of columns in the Array

$Rows - 1 ;= Index of Last element in Row
$Column - ;1 = Index of Last element in Column

Hope that helps

EDIT:

Yeah it should have said Column i Copy pasted and forgot to change that word

my bad

Edited by narayanjr

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Ive never really used any of the excel functions so I dont know anything about them but

$Rows = UBound($Find,1);Gives the number of rows in the Array
$Columns = UBound($Find,2);Gives the number of columns in the Array

$Rows - 1 ;= Index of Last element in Row
$Column - ;1 = Index of Last element in Row

Hope that helps

Yep, it helped me a lot. Thank you very much, narayanjr ! But, isn't it: "$Column - 1 ; = Index of Last element in Column"? :P

Edit: Sorry for the double-triple post, my internet is buggy and I've pressed "Add reply" several times, because I didn't see any response. I've deleted them now :)

Edited by Kiti

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0