Use VBA to make reference to last row of data

RLloyd

New Member
Joined
Aug 14, 2008
Messages
47
I have a sheet "System Data" with a few thousand rows of data across dozens of columns. I have another sheet ""Stats" with 40 Sumproduct (SP) formulas, each parsing multiple points of data. The SP formula can take 20 minutes to render, which is painful to sit through. I suspect SP looks through the entire million+ rows in the sheet, rather than only the rows with data. I would like a VBA solution that would create a new sheet that has the reference for the last row of data in System Data column "H", which I can use in the SP formulas. But if [you] think the constant references to the last-row reference in new sheet would also create a substantial lag, then I'm open to a a better way I have not considered.

Thank you. R Lloyd
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Excel formulas engine has built in mechanisms to work only on "used" part of spreadsheet. And this optimization works better and better with recent versions.

So there is a big chance that your formulas are simply rather complicated, and resource hungry.
Sometimes (as opposite to common sense) splitting complicated formulas into simpler ones with some partial results stored in helper columns help speeding workbook up signifficantly.
Especially if there are parts of formulas, which are repeated within the same or different formulas.

PS. As for last row via VBA in your data layout, I'd probably recommend: https://www.rondebruin.nl/win/s9/win005.htm
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,985
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top