Excel like a finance pro.
← The libraryPractice · 2 questions →
VBA · Ranges
Resize
A range with the same top-left cell but a new size.
OccasionalDifficulty 1200 · Proficient
When to use it
Resize returns a range with the same top-left cell and a new number of rows and columns.
The code
- Code
Range("A1").Resize(lastRow, 3)
Worked examples
Size to the data
Range("A1").Resize(lastRow, 3) → A1 down to row lastRow across three columns
Size to the data.
Drop the header
rng.Resize(rng.Rows.Count - 1).Offset(1) → The range without its header row
Skip a header.
Write an array
Range("D1").Resize(UBound(v, 1), UBound(v, 2)).Value = v → Writes an array back to exactly the right size
Array write-back.
Worth knowing
- Omit an argument to keep that dimension.
- Pair with Offset to skip headers.
- Resize before assigning an array, or only the first cell is written.
Where it goes wrong
- Resize does not move the top-left cell; Offset does.
- A size of 0 errors.
Related
Learn the moves here — or let Wauvel run them on your numbers.
Meet your AI CFO →One CFO-grade Excel tip a week
A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.