carlAlex
9/14/2017 - 7:31 AM

Extract useful stuff from stupid tables

Some simple subs to copy paste into a file in order to extract and arrange data from tables that have been made by...

Sub ExtractFALog()

Dim curDate As Date
Dim area As String
Dim activated As Date
Dim deactivated As Date


'Range("B1").Activate

Do While ActiveCell.Value <> ""

    curDate = ActiveCell.Value
    ActiveCell.Offset(4, 2).Activate
    
    Do While ActiveCell.Value <> ""
    
        If ActiveCell.Value <> "" Then
            area = ActiveCell.Value
            activated = ActiveCell.Offset(2, 0).Value
            deactivated = ActiveCell.Offset(3, 0).Value
            'PasteTheStuff
            
                Worksheets("Tab").Activate
                ActiveCell.Value = curDate
                ActiveCell.Offset(0, 1).Value = area
                ActiveCell.Offset(0, 2).Value = activated
                ActiveCell.Offset(0, 3).Value = deactivated
                ActiveCell.Offset(1, 0).Activate
                Worksheets("Log").Activate
            
        End If
        
        ActiveCell.Offset(0, 1).Activate
    
    Loop
    
    Range("B" & (ActiveCell.Row + 9)).Activate
    
    
Loop


End Sub