Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel VBA - select multiple columns not in sequential order

Tags:

excel

vba

I would like to select multiple columns.

Eg. I want to select column a, b, d, e, g, h

I've tried:

Columns("A, B, D, E, G, H").select

I get error message: Type mismatch.

like image 459
HL8 Avatar asked Jan 17 '12 00:01

HL8


1 Answers

Range("A:B,D:E,G:H").Select can help

Edit note: I just saw you have used different column sequence, I have updated my answer

like image 84
HRgiger Avatar answered Sep 16 '22 12:09

HRgiger