I have a requirement where I need to select Multiple columns using only the header names and this is my code for that ,
colmz = WorksheetFunction.Match("Sheet1", Sheets("Age").Rows(1), 0)
Nrowz = ActiveSheet.Cells(Rows.Count, colmz).End(xlUp).Row
Sheets("sheet1").Range(Cells(1, colmz), Cells(Nrowz, colmz)).Select
colm = WorksheetFunction.Match("Sheet1", Sheets("Gender").Rows(1), 0)
Sheets("sheet1").Range(Cells(1, colm), Cells(Nrowz, colm)).Select
I was able to select them individually but not together. How do I use them inside the range function and select both the columns together. Kindly give me your suggestions. Thanks in advance.