ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro autocode is not working after special paste. Why ?? (https://www.excelbanter.com/excel-programming/358183-macro-autocode-not-working-after-special-paste-why.html)

Eddy Stan

Macro autocode is not working after special paste. Why ??
 
Hi everyone,
I used record macro and got some code.
It works till copying in the new workbook.
After that I have done some formatting. It strucks up with the 2nd part of
my code below, what should change any help on this...
---- The following part works.
Application.Goto Reference:="SENDRANGE"
ActiveWindow.SmallScroll ToRight:=2
Selection.AutoFilter Field:=1, Criteria1:="SHOW"
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Select

--- NOT WORKING FROM THE FOLLOWING LINES.
Application.CutCopyMode = False
Range("a1").Select
Rows("5:5").EntireRow.AutoFit
Columns("H:Q").ColumnWidth = 12
Selection.NumberFormat = "#,##0_);[Red](#,##0)"
With ActiveWindow
.DisplayGridlines = False
.DisplayZeros = False
End With
Range("G5").Select
Columns("G:G").ColumnWidth = 9.86
Columns("D:D").EntireColumn.AutoFit
Columns("F:F").EntireColumn.AutoFit
Columns("E:E").EntireColumn.AutoFit
Columns("G:G").EntireColumn.AutoFit


[email protected]

Macro autocode is not working after special paste. Why ??
 
Hi
Seems to do as it is told on my machine. In what sense does it not
work?

regards
Paul



All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com