Error 1004
Error 1004

Reputation: 8220

Refer to multi dynamic ranges - VBA

I m trying to refer to two different ranges in the same formula but i am not getting the desirable outcoume.

Ranges:

.Range("A3:A" & LastRowA)
.Range("H3:H" & LastRowH)

Complete formula used:

.Range("A3:A" & LastRowA, "H3:H" & LastRowH).Interior.Color = vbRed

What i get:

enter image description here

Desirable outcome:

enter image description here

Upvotes: 1

Views: 36

Answers (1)

Error 1004
Error 1004

Reputation: 8220

i manage to find an answer. in case someone face the same issue:

Union(.Range("A3:A" & LastRowA), .Range("H3:H" & LastRowH)).Interior.Color = vbRed

Upvotes: 1

Related Questions