Results 1 to 4 of 4

Thread: Search column by its name

  1. #1

    Search column by its name



    Register for a FREE account, and/
    or Log in to avoid these ads!

    How can i search column by it header name?

    Code:
    processrow = Matchup(.Cells(i, "J").value, target.Columns(1))
                If processrow > 0 Then
    what i mean is, currently this code will search column 'J' but i want it search by its name for example 'Process'.
    instead of looking for 'J', it will find 'Process'

    Thanks.

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,479
    Articles
    0
    Excel Version
    365
    Quote Originally Posted by airbatucampur92@gmail.com View Post
    but i want it search by its name for example 'Process'. instead of looking for 'J', it will find 'Process'
    I've never heard of the function MatchUp so it's probably a function you have somewhere as code. At a guess it could be:

    processrow = Matchup("Process", target.Columns(1))


    or less likely:
    processrow = Matchup(.Cells(i, "J").value, "Process")
    We'd really need to see a bit more surrounding code and the MatchUp function too.

  3. #3
    Sorry for not giving you full code
    I have example like below

    let say my C column is 'Address.
    how to replace it

    Code:
    yearidx = Year(.Cells(i, "C").value) - Application.Min(target.Rows(1))                
    monthidx = Month(.Cells(i, "C").value)
                    If Application.CountA(target.Rows(processrow)) > 1 Then
                        processrow = processrow + 1
                        target.Rows(processrow).Insert
                    End If
    thanks.

  4. #4
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,479
    Articles
    0
    Excel Version
    365
    I understand even less now!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •