Hi
I'm hoping someone can help me before I set my PC alight and send it hurtling to a fiery doom out one of our office windows.
I've recorded a macro in which I unhide certain columns, copy and paste some information then hide those columns again. The problem is that when the macro is finished, it incorrectly hides columns K to AN. I did not record that and it's not in the code so I'm lost as to why it's happening.
The macro is as follows (sorry about the length):
I have no idea why it's hiding everything from K to AN. I've tried recording the macro several times but it's just not working, no matter the order in which I hide columns when recording it.
If anyone can offer any help, I'd be very appreciative.
Cheers
I'm hoping someone can help me before I set my PC alight and send it hurtling to a fiery doom out one of our office windows.
I've recorded a macro in which I unhide certain columns, copy and paste some information then hide those columns again. The problem is that when the macro is finished, it incorrectly hides columns K to AN. I did not record that and it's not in the code so I'm lost as to why it's happening.
The macro is as follows (sorry about the length):
Code:
Sub COPY()
'
' COPY Macro
'
'
Application.ScreenUpdating = False
Columns("K:BT").Select
Selection.EntireColumn.Hidden = False
Range("M5:N24").Select
Selection.COPY
Range("O5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("S5:T24").Select
Application.CutCopyMode = False
Selection.COPY
Range("U5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Y5:Z24").Select
Application.CutCopyMode = False
Selection.COPY
Range("AA5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AE5:AF24").Select
Application.CutCopyMode = False
Selection.COPY
Range("AG5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AK5:AL24").Select
Application.CutCopyMode = False
Selection.COPY
Range("AM5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll ToRight:=19
Range("AQ5:AQ24").Select
Application.CutCopyMode = False
Selection.COPY
Range("AR5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AT5:AT24").Select
Application.CutCopyMode = False
Selection.COPY
Range("AU5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AW5:AW24").Select
Application.CutCopyMode = False
Selection.COPY
Range("AX5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AX5:AX24").Select
Application.CutCopyMode = False
Range("AY5:AY24").Select
Selection.COPY
Range("AZ5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BA5:BA24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BB5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BC5:BC24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BD5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BE5:BE24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BF5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BG5:BG24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BH5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BI5:BI24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BJ5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BK5:BK24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BL5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BN5:BN24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BO5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BP5:BP24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BQ5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("BR5:BR24").Select
Application.CutCopyMode = False
Selection.COPY
Range("BS5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("M:N").Select
Selection.EntireColumn.Hidden = True
Columns("S:T").Select
Selection.EntireColumn.Hidden = True
Columns("Y:Z").Select
Selection.EntireColumn.Hidden = True
Columns("AE:AF").Select
Selection.EntireColumn.Hidden = True
Columns("AK:AL").Select
Selection.EntireColumn.Hidden = True
Columns("AQ:AQ").Select
Selection.EntireColumn.Hidden = True
Columns("AT:AT").Select
Selection.EntireColumn.Hidden = True
Columns("AW:AW").Select
Selection.EntireColumn.Hidden = True
Columns("AY:AY").Select
Selection.EntireColumn.Hidden = True
Columns("BA:BA").Select
Selection.EntireColumn.Hidden = True
Columns("BC:BC").Select
Selection.EntireColumn.Hidden = True
Columns("BE:BE").Select
Selection.EntireColumn.Hidden = True
Columns("BG:BG").Select
Selection.EntireColumn.Hidden = True
Columns("BI:BI").Select
Selection.EntireColumn.Hidden = True
Columns("BK:BK").Select
Selection.EntireColumn.Hidden = True
Columns("BN:BN").Select
Selection.EntireColumn.Hidden = True
Columns("BP:BP").Select
Selection.EntireColumn.Hidden = True
Columns("BR:BR").Select
Selection.EntireColumn.Hidden = True
Range("D3:J3").Select
Application.ScreenUpdating = True
End Sub
I have no idea why it's hiding everything from K to AN. I've tried recording the macro several times but it's just not working, no matter the order in which I hide columns when recording it.
If anyone can offer any help, I'd be very appreciative.
Cheers