I'm trying to run a macro but it doesn't seem to want to play...
What I want it to do..
I have a hidden sheet called Test, I want to copy some data from the active worksheet (eg Jan), unhide the sheet Test, paste the info into the worksheet Test, remove any cells that are blank, set column into ascending order, change the font size, then print the info, remove all the info I have just pasted, then hide the worksheet Test again.
I want this to run, so no matter which worksheet im on, (ie, Jan, Feb, Mar etc) it will copy the Range("B21:B46,N21:N46") and paste it into the worksheet Test
Where am I going wrong? Can anyone help ?
Code:
Sub Macro4()
Range("B21:B46,N21:N46").Select
Range("N21").Activate
Selection.Copy
Sheets("Test").Visible = True
Range("A4").Select
ActiveSheet.Paste
Selection.SpecialCells(xlCellTypeBlanks).Select
Application.CutCopyMode = False
Selection.EntireRow.Delete
Range("A4").Select
Range("A4:B19").Sort Key1:=Range("A4"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Cells.Select
With Selection.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.Delete Shift:=xlUp
ActiveWindow.SelectedSheets.Visible = False
End Sub
Social Networking Bookmarks