Jump to content

2D Array


Recommended Posts

Link to comment
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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...