I am currently working on this spreadsheet and am running into massive difficulties. Essentially, I am trying to find the column index number that contains the range name "Average".
So, if "Average" is in column index 22, then 22 will be returned, etc.
Range("AA1").Select
Selection.Name = "Average"
Dim colNumber As Integer
colNumber = WorksheetFunction.Match("Average", ActiveWorkbook.Sheets(Sheet1).Range("1, Average"), 0) 'Average is a range name
Columns(colNumber).Insert
Each time I get different errors for this line, ranging from type mismatch to global_ failure:
colNumber = WorksheetFunction.Match("Average", ActiveWorkbook.Sheets(Sheet1).Range("1, Average"), 0)
I've searched everywhere looking for how to find a column index number based on a range name within a range, and I can't find anything. Any help is hugely appreciated.
Thank you!