VBA Excel - Obtenha o valor de um Range fazendo Looping entre as Abas - Loop Through Sheets and get Value from a range

Sub LoopThroughSheetsGetValue()

    Dim ws As Worksheet
    Worksheets("Total").Range("A2:B100").ClearContents

    For Each ws In ActiveWorkbook.Worksheets
        If ws.Name <> ("Total") Then

            If ws.Visible = True Then
                Let Range("A65536").End(xlUp).Offset(1, 0) = ws.Name
                Let Range("A65536").End(xlUp).Offset(0, 1) = _
                Format(ws.Range("D8"), "h:mm;@")    'Tota da Horas

            End If
        End If
    Next ws
    
End Sub

Tags: Excel, VBA, Loop, Sheets, get, range, value, 


Inline image 1

Nenhum comentário:

Postar um comentário

diHITT - Notícias