2

Does anyone know how I can substitute the following code with a dynamic one that is linked to specific cells?

i.e. replace this

dim array1()
array1=range("a150:k250")

with something similar to that

dim array1()
array1=range(application.indirect("a"&c1&":k"&d1)

where c1 contains the value 150 and d1 the value 250

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188

1 Answers1

2

Drop the indirect, use the Value property on C1 and D1 instead:

array1=Range("a" & Range("c1").Value & ":k" & Range("d1").Value)

Bathsheba
  • 231,907
  • 34
  • 361
  • 483