0

I have several worksheets in an Excel and each of the worksheets contain 1 Form. I have grouped similar forms into an array in order to apply a function across all relevant worksheets.

FORM_01 = Array(FORM001.Name,FORM_001_001.Name)
FORM_02 = Array(FORM002.Name, FORM_002_001.Name)

Can I concatenate FORM_01 and FORM_02 into a new consolidated array like this?

FORM_combine =Array(FORM001.Name,FORM_001_001.Name,FORM002.Name, FORM_002_001.Name)

Thanks.

Community
  • 1
  • 1
Eric
  • 357
  • 1
  • 4
  • 14
  • Possible duplicate of [How do I Merge two Arrays in VBA?](https://stackoverflow.com/questions/1588913/how-do-i-merge-two-arrays-in-vba) – Pᴇʜ Sep 18 '17 at 07:03

1 Answers1

0

Something like this

FORM_01 = Array("a", "b")
FORM_02 = Array("c", dD")
FORM_combine = Split(Join(FORM_01, Chr(1)) & Chr(1) & Join(FORM_02, Chr(1)), Chr(1))

This will give FORM_combine as ("a", "b", "c", "d")

Got this from here.

Mrig
  • 11,612
  • 2
  • 13
  • 27