+ Reply to Thread
Results 1 to 2 of 2

Thread: search worksheet

  1. #1
    anderssweden
    Guest

    search worksheet

    I am making an automated reporting system for a bank. I copy information from
    another program and insert it into excel. The information is columns with
    headllines. Since the order of the info is somewhat different each time I
    want to write a macro that identifies the headlines and places the
    information in proper order. (I am a beginner in VisualBasic). Very thankful
    for fast relpy!
    --
    banker

  2. #2
    Tom Ogilvy
    Guest

    RE: search worksheet

    Assume our headers are in Row 1 of whichever sheet you need to search. You
    can find which column they are in with

    Dim sHdr as String, sh as Worksheet, rng as Range
    Set sh = Worksheets("SheettoSearch")
    sHdr = "LastName"
    set rng = sh.Range("A1:IV1").Find(sHdr)
    if not rng is nothing then
    msgbox "Found at " & rng.Address(0,0,xlA1,True)
    Else
    msgbox sHdr & " Not found"
    end if

    --
    regards,
    Tom Ogilvy



    "anderssweden" wrote:

    > I am making an automated reporting system for a bank. I copy information from
    > another program and insert it into excel. The information is columns with
    > headllines. Since the order of the info is somewhat different each time I
    > want to write a macro that identifies the headlines and places the
    > information in proper order. (I am a beginner in VisualBasic). Very thankful
    > for fast relpy!
    > --
    > banker


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0