Sign in to follow this  
Followers 0
stickwiththescript

Another Excel question with Autoit

5 posts in this topic

#1 ·  Posted

I have over 43,000 rows of cells in (column A) of my excel sheet that are filled with information and used as headings for my blog posts.

The goal is that I want to break all those individual cells into single parts where I can access them individually with my script by assigning a variable to the specific cell that I need to use.

Would it be best to use an array to be able to access all of those cells from the excel sheet?

Share this post


Link to post
Share on other sites



#2 ·  Posted

@stickwiththescript welcome to the forum. Yes, you can use _Excel_RangeRead to read the column into an array. Something like this:

#include <Array.au3>
#include <Excel.au3>

Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\Test.xls") ;Workbook with A1-A43000 filled
Local $aArray = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"))
    _ArrayDisplay($aArray)

Depending on how unique the different entries are, you could then use _ArraySearch, like this (I simply numbered the cells 1 to 43,000):

MsgBox(0, "", "Search Item found on row " & _ArraySearch($aArray, 18246))

 

1 person likes this

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

#3 ·  Posted

Excellent! Thankyou. The array display function displays all the rows perfectly. The only problem is that the message box reads out "Search item found on row -1".

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

because you dont have 18246 value in Column A:A, type in the value 18246 any where in column A in excel

Edited by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

#5 ·  Posted

Yes, as 232showtime explains, replace 18246 with whatever value you're searching for :)


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

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