ThisWorkbook.Sheets("Sheet1").Activate
Range("Sheet2!F8") = Application.Sum(Application.Index(Range("A:MN"), 0, Application.Match("Jack", Range("A2:MN2"), 0)))
End Sub
I have been working with a excel file with lot a data. So I have comeup with a VBA code(mentioned above) this will look for the column named “Jack” in sheet1 and will return the sum of the whole column in Sheet2 F8. But I would like to include one more MATCH function to this which is
Application.Match(“Salary_2010”,Range(B3:B50”)
Salary_2010(cell B) is basically rows and next to this I have each month. There are salary_2011,salary_2012 and so on. So basically im doing a summary table. So I would like to get the information like sum of salary_2010 jack got in Sheet2F8,salary_2011 in G8 and so on. I would like to refer to the column headings as the reference. Can somebody help me join this two match functions to get the outcome .Thanks
Range("Sheet2!F8") = Application.Sum(Application.Index(Range("A:MN"), 0, Application.Match("Jack", Range("A2:MN2"), 0)))
End Sub
I have been working with a excel file with lot a data. So I have comeup with a VBA code(mentioned above) this will look for the column named “Jack” in sheet1 and will return the sum of the whole column in Sheet2 F8. But I would like to include one more MATCH function to this which is
Application.Match(“Salary_2010”,Range(B3:B50”)
Salary_2010(cell B) is basically rows and next to this I have each month. There are salary_2011,salary_2012 and so on. So basically im doing a summary table. So I would like to get the information like sum of salary_2010 jack got in Sheet2F8,salary_2011 in G8 and so on. I would like to refer to the column headings as the reference. Can somebody help me join this two match functions to get the outcome .Thanks