Jump to content

Getting Value from Last Used Row in a defined range


Siwa
 Share

Recommended Posts

@water Hey, I believe we have a misunderstanding here. :) I don't select cells or ranges, activate sheets, etc. unless they are necessary as well. You have missed a couple of pointers:

- I am new to AutoIt, been using it for the last 2 weeks.

- Never used Excel UDF myself. Helped another friend in another post, and now this. 

- Most examples I have seen, required to select a cell or something. I am not even sure if this is an AutoIt requirement?

- In VBA if you need it, you just "Dim MyRange as Range" and "Set MyRange = Range(address)", and use it ("Set MyRange = Nothing", when finished). Or just reference it directly. Depends on what you want to achieve.

- What I wrote above is a step-by-step analysis (if you would like to call it that)

- This was the final verdict, no selects, no selections. And you can use whatever range definition you got, doesn't have to be UsedRange, Selection, CurrentRegion.:

"Array = UsedRange.Resize(,5).Offset(0,6) - (here offset number for column should change since now you are offsetting from the start column rather than C). Get your array in 1 line of code, and it is fast."

- If you don't need the initial range, why store it anywhere? (Ofcourse, it is better to store in a variable if it will be reused). Or get the contents in an array for some calculations as arrays are faster. This part depends on what you want to achieve as well.

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...