I am having an issue with switching worksheets within one workbook. Please have a look at the following:
Set chs = Range("1:1")
Set Employ = chs.Find("Employee")
Set Sal = chs.Find("Salary")
Worksheets("Sheet1").Activate
a = Range(Columns(Employ.Column), Columns(Sal.Column)).Select
Worksheets("Sheet2").Activate
b = Range(Columns(Employ.Column), Columns(Sal.Column)).Select
What I want the program to do is activate sheet1 and then select the columns with the headings "Employee" and "Salary" (I define these below), and then activate sheet2 and then select the columns with the headings "Employee" and "Salary" again that is specifically in the activated sheet.
However, this is what it is doing. Say in sheet1, the columns for employee and salary are A and F. These will be selected just fine with everything in between. But when activating sheet2, if I try to select the columns employee and salary that are say columns B and K respectively, it will still only select columns A to F. The reverse also happens: if I activate sheet 2 first instead, it will select the columns B to K in sheet1, which doesn't match up to the headings.
Any help is appreciated.