Excel 2002, Windows XP
Hello all: I have a problem with the below code hanging on ( Selection.PasteSpecial Paste:=ColumnWidths). Why does it not let me copy the Column With? Basicaly the code inserts a new sheet and then copies data fron sheet (Main) to it. Thanks Dan
ActiveSheet.Unprotect
Range("A2").Select
Selection.Copy
Range("K6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A14").Select
Range("A14").Select
Range("B2:S60").Select
Selection.Copy
Sheets.Add
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=ColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(12, 0).Range("A1:F1").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$S$59"
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
ActiveSheet.Range("J5").Activate
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Range("A1").Activate
Sheets("Main").Select
ActiveWindow.SmallScroll Down:=-51
Application.CutCopyMode = False
Range("A14").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End With
End Sub
Hello all: I have a problem with the below code hanging on ( Selection.PasteSpecial Paste:=ColumnWidths). Why does it not let me copy the Column With? Basicaly the code inserts a new sheet and then copies data fron sheet (Main) to it. Thanks Dan
ActiveSheet.Unprotect
Range("A2").Select
Selection.Copy
Range("K6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A14").Select
Range("A14").Select
Range("B2:S60").Select
Selection.Copy
Sheets.Add
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=ColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(12, 0).Range("A1:F1").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$S$59"
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
ActiveSheet.Range("J5").Activate
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Range("A1").Activate
Sheets("Main").Select
ActiveWindow.SmallScroll Down:=-51
Application.CutCopyMode = False
Range("A14").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End With
End Sub