Use CurrentRegion or UsedRange - to see in VBA inner help - combined to Rows & Columns …
As you can also activate the Macro Recorder, open the workbook, add the formula to the first cell, copy down,
close & save the workbook then post the generated code here
- with the code tags or via icon as per forum rules -
in order to get an optimization if really needed …
But if it's only to be used once, a code is totally useless ! Just use a formula then Copy the result and PasteSpecials as value
which is faster than creating a thread on any forum and waiting for someone may decypher your need …
Bookmarks