Results 1 to 3 of 3

VBA VLookup in Workbook with Multiple Sheets

Threaded View

  1. #1
    Registered User
    Join Date
    05-14-2014
    MS-Off Ver
    Excel 2003
    Posts
    7

    VBA VLookup in Workbook with Multiple Sheets

    I am trying write code for a Vlookup based on the current date in d-mmm form. I would like the code to search through each worksheet, there will be a worksheet for each calendar month, and return the value of different categories of disbursements. I am not sure how to do this and went searching on the web for something similar, and tried to adapt it, but I think my coding for the function is not correct, so I get an error.
    I would like the values for each disbursement category and return them to the TestBook2.xlsm workbook under the disbursements tab.

    If anyone could help, I'd really appreciate. I have attached sample spreadsheets and the code below:

    Sub Looking()
    Dim Disb As Workbook
    Dim Wsht As Worksheet
    Dim Search As Date
    Dim FindIt As Integer
    
    
    What = Format(Date, "d-mmm")
    
    For Each Wsht In ActiveWorkbook.Worksheets
    
        With Wsht
        Set Tble_Array = .Range("A2", "A35")
    
            FindIt = WorksheetFunction.VLookup(What, Sheets(.Index).Range("A4:A29"), 6, False)
    End With
    
    If Not IsEmpty(FindIt) Then Exit For
    Next Wsht
    
    Set Tble_Array = Nothing
    VLOOKAllSheets = FindIt
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Vlookup from one workbook to another workbook with multipule sheets
    By sally.simpkin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-30-2013, 06:22 AM
  2. [SOLVED] Macro to copy cells from multiple sheets in workbook to multiple sheets in other workbook
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2013, 05:37 PM
  3. [SOLVED] Highlighting the same cell in one workbook with multiple sheets with various sheets names.
    By DanielRay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 01:50 PM
  4. VLOOKUP across multiple sheets on a different workbook.
    By JamesCBC in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-05-2013, 09:38 AM
  5. Replies: 4
    Last Post: 08-17-2006, 01:30 AM

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.6.0 RC 1