What does my macro script do?

glenn masters
glenn masters used Ask the Experts™
on
Hi I'm tidying up workbooks and come across this macro and not got a clue what it does. Possibly think that it updates headers on a workbook that I have but don't know where or what it is.    Can anyone advise me on what it does?

Thanks

Sub update()
'
' update Macro
' Macro recorded 08/05/2006 by Silverlink Train Services
'

'
    Workbooks.Open Filename:="S"
   
    :\SHARED\passacc\Excel\passacc\SUMMARY.xls", _
        UpdateLinks:=3
    Windows("CONTROL.XLS").Activate
    ActiveWindow.ScrollColumn = 32
    ActiveWindow.ScrollColumn = 31
    ActiveWindow.ScrollColumn = 30
    ActiveWindow.ScrollColumn = 29
    ActiveWindow.ScrollColumn = 28
    ActiveWindow.ScrollColumn = 27
    ActiveWindow.ScrollColumn = 26
    ActiveWindow.ScrollColumn = 25
    ActiveWindow.ScrollColumn = 24
    ActiveWindow.ScrollColumn = 23
    ActiveWindow.ScrollColumn = 22
    ActiveWindow.ScrollColumn = 21
    ActiveWindow.ScrollColumn = 20
    ActiveWindow.ScrollColumn = 19
    ActiveWindow.ScrollColumn = 18
    ActiveWindow.ScrollColumn = 17
    ActiveWindow.ScrollColumn = 16
    ActiveWindow.ScrollColumn = 15
    ActiveWindow.ScrollColumn = 14
    ActiveWindow.ScrollColumn = 13
    ActiveWindow.ScrollColumn = 12
    ActiveWindow.ScrollColumn = 11
    ActiveWindow.ScrollColumn = 10
    ActiveWindow.ScrollColumn = 9
    ActiveWindow.ScrollColumn = 8
    ActiveWindow.ScrollColumn = 7
    ActiveWindow.ScrollColumn = 6
    ActiveWindow.ScrollColumn = 5
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 1
    Range("A14:AT14").Select
    Selection.Copy
    Windows("SUMMARY.xls").Activate
    Sheets("Sheet2").Select
    ActiveWindow.SmallScroll Down:=-66
    ActiveWindow.ScrollRow = 94
    ActiveWindow.ScrollRow = 92
    ActiveWindow.ScrollRow = 90
    ActiveWindow.ScrollRow = 87
    ActiveWindow.ScrollRow = 86
    ActiveWindow.ScrollRow = 83
    ActiveWindow.ScrollRow = 79
    ActiveWindow.ScrollRow = 75
    ActiveWindow.ScrollRow = 70
    ActiveWindow.ScrollRow = 67
    ActiveWindow.ScrollRow = 62
    ActiveWindow.ScrollRow = 57
    ActiveWindow.ScrollRow = 53
    ActiveWindow.ScrollRow = 48
    ActiveWindow.ScrollRow = 43
    ActiveWindow.ScrollRow = 39
    ActiveWindow.ScrollRow = 34
    ActiveWindow.ScrollRow = 29
    ActiveWindow.ScrollRow = 26
    ActiveWindow.ScrollRow = 21
    ActiveWindow.ScrollRow = 16
    ActiveWindow.ScrollRow = 13
    ActiveWindow.ScrollRow = 10
    ActiveWindow.ScrollRow = 6
    ActiveWindow.ScrollRow = 4
    ActiveWindow.ScrollRow = 2
    ActiveWindow.ScrollRow = 1
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 1
    Range("C6").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    ActiveWindow.SmallScroll Down:=27
    Windows("CONTROL.XLS").Activate
    Range("A19:AT19").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("SUMMARY.xls").Activate
    ActiveWindow.SmallScroll Down:=-35
    Range("H6").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    Cells.Select
    Application.CutCopyMode = False
    With Selection.Font
        .Name = "AvantGarde"
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
    End With
    With Selection.Font
        .Name = "AvantGarde"
        .Size = 14
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
    End With
    With Selection.Font
        .Name = "AvantGarde"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
    End With
    Range("B2").Select
    ActiveWorkbook.Save
    ActiveWindow.SmallScroll Down:=5
    ActiveWindow.Close
End Sub
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
Commented:
Glenn

Don't know about headers, the code is copying from rows (A14:AT14, A19,AT19) and transposing to columns (C, H).

It the formats all the cells in the active sheet of 'MASTER.xls' 3 times - only the last part of that will 'count'.

Here's the code tidied up a bit.
Sub update()
'
' update Macro
' Macro recorded 08/05/2006 by Silverlink Train Services
'

'
    Workbooks.Open Filename:="S:\SHARED\passacc\Excel\passacc\SUMMARY.xls", _
        UpdateLinks:=3
        
    Workbooks("CONTROL.XLS").ActiveSheet.Range("A14:AT14").Copy
    
    Workbooks("SUMMARY.xls").Sheets("Sheet2").Range("C6").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
        
    Workbooks("CONTROL.XLS").ActiveSheet.Range("A19:AT19").Copy
    
    Workbooks("SUMMARY.xls").Sheets("Sheet2").Range("H6").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
            
    With Workbooks("SUMMARY.xls").Sheets("Sheet2").Cells.Font
        .Name = "AvantGarde"
        .Size = 12
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
    End With
            
    Workbooks("SUMMARY.xls").Close SaveChanges:=True
    
End Sub

Open in new window

glenn mastersmanager

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial