DJ143 Posted July 15, 2015 Share Posted July 15, 2015 I have a sheet it has 5 columns and more than 1000 rows. I have to identify a row by its 1st and 5th column and get the values of 2,3 and 4 column values in that particular row. I have used For loop but this is taking more time for identifying the row. Please help in resolving this problem. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 15, 2015 Moderators Share Posted July 15, 2015 You have very nicely defined what you want, however you have not shown what you have tried to accomplish on your own. Please start with looking at the Excel functions in the help file. There are a couple of ways you could tackle the problem. For the simplest, try something like this: Look at _Excel_Open() and _Excel_BookOpen() to open the workbook in question. Look at _Excel_RangeRead, read the range into an array and then parse through the array looking for your values. I'll leave you to tweak this to your needs...;psuedo _excel_open _excel_bookopen(<path to book>) $aRange = _excel_rangeread(workbook, worksheet, range) For $i = 0 to ubound($arange) - 1 If $arange column 1 = x and $arange column 5 = y Then return $arange columns 2, 3 and 4 EndIf Next "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
DJ143 Posted July 22, 2015 Author Share Posted July 22, 2015 hi.. that was very helpful.. with arrays it could find in less time than before. performance got increase. thank you. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 22, 2015 Moderators Share Posted July 22, 2015 Glad to be of assistance. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now