ОК, вот пара функций, которые вы можете использовать, чтобы определить, в каком столбце находится конкретный заголовок. Получив столбец и строку, вы можете использовать их для установки целевого диапазона.
Function Find_Column_Heading(ByRef shTarget As Worksheet, ByVal myHeading As String) As Long
'search row 1 of shTarget for a specific heading and return the column number
Dim intMaxCol As Long, intColCount As Long, varFindCell As Variant, rngToLookIn As Range
intMaxCol = shTarget.Cells(1, shTarget.Columns.Count).End(xlToLeft).Column
Set rngToLookIn = shTarget.Range(shTarget.Cells(1, 1), shTarget.Cells(1, intMaxCol))
Set varFindCell = rngToLookIn.find(what:=myHeading, after:=shTarget.Cells(1, 1), lookat:=xlWhole, LookIn:=xlValues)
If Not varFindCell Is Nothing Then
Find_Column_Heading = varFindCell.Column
Else
Find_Column_Heading = intMaxCol + 1
End If
End Function
Function Find_Bottom_Row(ByRef shTarget As Worksheet, intColumn As Long) As Long
'this will return the row of the empty cell below the lowest used cell in the specified column
Find_Bottom_Row = shTarget.Cells(shTarget.Rows.Count, intColumn).End(xlUp).Row + 1
End Function
Dim rFoundCell As Range, NextFoundCell As Range 'Add a new variable
Set NextFoundCell = rFoundCell.Offset(0, 1) 'this selects the cell to the right of the search target
'Create a range of found cells.
If Not rAllFoundCells Is Nothing Then
Set rAllFoundCells = Union(rAllFoundCells, NextFoundCell) 'add the cell to the right to the result range
Else
Set rAllFoundCells = NextFoundCell
End If