Help making a macro that passes whole columns according to its heading


Hi, I have a problem with a macro that I try to perform, before I had it with the macro recorder but then the tables started to grow and the headers change places every week, so now I want to select an entire column according to the headline title of that column and move them to another worksheet, What I have tried is the following:

Sub Seleccionar()

For i = 1 To 10
If (Cells(1, i).Value = "Titulo 21") Then
Cells(1, i).Select
End If

End Sub

but I do not even select the cell of the title itself does not do anything macro and I do not know how to indicate which columns I want to select and copy and paste on another sheet, if they have any idea since I could not find a single example Do more or less the same, in advance thanks

asked by R. Nuñez 15.11.2018 в 00:04

0 answers