0

I am using a function to extract numbers from string , then split it’s values into a range.
I need if possible to insert the values into Target without Loop Target.
Grateful for your help.

Dim arr
arr = Split(ExtractNumbers(str)) 'ExtractNumbers is a Function ,str is a string
 
For n = 0 To UBound(arr)
   Target.Offset(n) = arr(n)
Next n
2
  • 2
    Target.Resize(UBound(arr) + 1).Value = Application.Transpose(arr). Split returns a 1D array, so use Transpose when writing to the sheet. Commented Aug 2, 2022 at 14:27
  • 1
    Transpose does have a limit of around 65k rows, but I assume it's appropriate for your setup. Commented Aug 2, 2022 at 14:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.