Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88886

Name Range in an array

$
0
0

I have a variant variable which contains two name ranges. I try to copy the range using the name of the range stored in the variable but i do not know how to do it. Please see below my code. Any suggestions?

Dim tbl2 As Range
Dim tablearray2 As Variant

Application.ScreenUpdating = False
Application.EnableEvents = False

tablearray2 = Worksheets("Sheet2").Range("C2:C3") **<--- Here i store the name of the ranges in the tablearray2 variable**

'The tablearray2 now contains the following values: Table1, Table2 which are the names of two different ranges.

Set tbl2 = tablearray2(2,1)

tbl2.copy

End Sub

Thank you for your help


Viewing all articles
Browse latest Browse all 88886


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>