Results 1 to 3 of 3

Thread: Macro to search Invoices through tabs

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    99

    Macro to search Invoices through tabs

    i want to Search invoice numbers in "Collection report" tab "H" column and search in "Iogixinv" tab "E" column and highlight the available ones in "Collection report" tab "H" column.

    There are few invoice numbers in the cell in "Collection report" tab "H" column which are mentioned after Semi colon (; )

    since the work book has high amount of data need to make it faster.

    how do i write a macro for this?


    Name:  collection.jpg
Views: 190
Size:  60.4 KB

    Name:  inv.JPG
Views: 175
Size:  81.4 KB
    Attached Files Attached Files

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    99

    Question Re: Macro to search Invoices through tabs

    i wanted to do this with below code

    go to "Collection report" tab,Column "H" and start from cell "H2"and need to copy numbers before and after ";" and search in "Iogixinv" tab, column "E". if avilable "BOLD" the same number in "Collection report" tab,Column "H" and if not available make that number ITALIC in "Collection report" tab,Column "H"




    Sub FormatNumbersInCollectionReport()
    Dim wsCollection As Worksheet
    Dim wsLogin As Worksheet
    Dim cell As Range
    Dim numbers As Variant
    Dim number As Variant
    Dim found As Range

    Set wsCollection = ThisWorkbook.Sheets("Collection report")
    Set wsLogin = ThisWorkbook.Sheets("Iogixinv")

    For Each cell In wsCollection.Range("H2:H" & wsCollection.Cells(wsCollection.Rows.Count, "H").End(xlUp).Row)
    numbers = Split(cell.Value, ";")
    For Each number In numbers
    number = Trim(number)
    Set found = wsLogin.Columns("E").Find(What:=number, LookIn:=xlValues, LookAt:=xlWhole)
    If Not found Is Nothing Then
    cell.Font.Bold = True
    Else
    cell.Font.Italic = True
    End If
    Next number
    Next cell
    End Sub
    after the above code everything gets italic and once that available are also getting bold.. please help

    Name:  Capture.jpg
Views: 146
Size:  26.1 KB

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    99

    Re: Macro to search Invoices through tabs

    anyone there to give a me a helping hand..please

Posting Permissions

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



Click Here to Expand Forum to Full Width