Transfering a Worksheet Range into an Array and back to the sheet in Excel VBA- Code included

Опубликовано: 15 Октябрь 2024
на канале: EverydayVBA
21,426
109

Grab the Free VBA Quick Reference Guide
https://www.chrisjterrell.com/excel-v...
This video shows how to easily copy or transfer data from a worksheet range into a VBA array and how to transfer or past it back on the sheet.

When working with large data sets this is the preferred method because it is a lot faster. All the calculations and work is done in memory instead of doing it on the screen.

Code

Sub Range_to_Array()
Range("A1:i1").Select
oarray = Range("A1:i1")

oarray(1, 1) = "New MPG"
oarray(1, 9) = "Car"

Range("A1:i1") = oarray

End Sub