hi all
i would like an excle vba that would filter multiple columns based on a certain criteria.
i have 3 columns one is called "col1" the other one is called "col2" and the other one is called "col3" the columns will always be at row #14
but here is the problem for whatever reason, without going in to details here why that is, but my columns are always being moved around for ex. "col 1" header can be anywhere from lets say cell N14 to cell R14 so what i need is that the vba should look where that column header is and then filter it, the same with the other columns it can get moved around
my goal is for the vba to finds all headers "col 1","col 2", "col 3" and filter it based on certain criteria
any help is greatly appreciated
it would look something like this
Dim rngFind As Range
Dim rngCell As Range
Dim strColumn As String
Dim intFindColumn As Integer
Set rngFind = Cells.Find("col 1", LookIn:=xlValues, LookAt:=xlWhole, SearchDirection:=xlNext)
If Not rngFind Is Nothing Then
If Target.Column = rngFind.Column Then....
but i don't know how to use this code for what i want
i would like an excle vba that would filter multiple columns based on a certain criteria.
i have 3 columns one is called "col1" the other one is called "col2" and the other one is called "col3" the columns will always be at row #14
but here is the problem for whatever reason, without going in to details here why that is, but my columns are always being moved around for ex. "col 1" header can be anywhere from lets say cell N14 to cell R14 so what i need is that the vba should look where that column header is and then filter it, the same with the other columns it can get moved around
my goal is for the vba to finds all headers "col 1","col 2", "col 3" and filter it based on certain criteria
any help is greatly appreciated
it would look something like this
Dim rngFind As Range
Dim rngCell As Range
Dim strColumn As String
Dim intFindColumn As Integer
Set rngFind = Cells.Find("col 1", LookIn:=xlValues, LookAt:=xlWhole, SearchDirection:=xlNext)
If Not rngFind Is Nothing Then
If Target.Column = rngFind.Column Then....
but i don't know how to use this code for what i want