+ Reply to Thread
Results 1 to 1 of 1

Draw Data from multiple sheets:

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2009
    Location
    Jhb, South Africa
    MS-Off Ver
    Excel 2003/07
    Posts
    4

    Draw Data from multiple sheets:

    Hi

    I am trying to draw data from multiple sheets.

    I am using some code I got from ozgrid.com to draw my own invoices to one sheet:

    function VLOOKAllSheets(Look_Value As Variant, Tble_Array As Range, _
                              Col_num As Integer, Optional Range_look As Boolean)
    
    Dim wSheet As Worksheet
    
    Dim vFound
    
    
    
    On Error Resume Next
    
    
    
        For Each wSheet In ActiveWorkbook.Worksheets
            With wSheet
            Set Tble_Array = .Range(Tble_Array.Address)
                vFound = WorksheetFunction.VLookup _
                (Look_Value, Tble_Array, _
                Col_num, Range_look)
            End With
    
            If Not IsEmpty(vFound) Then Exit For
    
        Next wSheet
    
    
    
        Set Tble_Array = Nothing
    
        VLOOKAllSheets = vFound
    
    End Function

    That works brilliantly IF you have the invoice number, but where I am putting in supplier invoices and the numbers are different.


    We have 1 sheet for every day of the month.
    How can I return the values of the cell simply by the condition that they are populated? I have about 10 rows allocated for everyday, but usually we only use 2 or 3, once a week or so we use all 10. I could use absolute reverence, but that would mean up to 8 blank rows for every day.

    Is there any way for it just to return the cells, in order, from all the sheets skipping the blank ones?

    Thanks
    Mark
    Last edited by markellis88; 06-07-2009 at 09:06 AM.

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