Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
HI, i have been running the following code every day for 5 months with no issues, it now debugs, with the following error "we cannot paste because the copy screen and paste area arent the same size. The spreadsheet the data is dumped in is purely an archive which is not used on a daily basis. I think i need to change the code to avoid any formatting issues, but cannot work out what to change.
Dim xm As Long
Sheets("submissions").Select
ActiveSheet.ShowAllData
Columns("H").Select
Range("p1").Activate
Selection.EntireColumn.Hidden = True
Columns("t:v").Select
Range("v1").Activate
Selection.EntireColumn.Hidden = True
ActiveSheet.Range("A:w").AutoFilter Field:=18, Criteria1:="<>"
ActiveSheet.Range("A:w").AutoFilter Field:=23, Criteria1:="<>"
Range("D2:AC2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Workbooks.Open Filename:= _
"S:\4th Floor\SQ Operations\OPs Mi Spreadsheets\Allocation audit tools\Allocation Data\test.xlsx"
Range("a1").Select
xm = Range("A" & Rows.Count).End(xlUp).Row + 1
Range("a" & xm).PasteSpecial xlPasteValues
Any help would ne much appreciate...
when i debug it is highlighting the last line of the code,
Range("a" & xm).PasteSpecial xlPasteValues
Dim xm As Long
Sheets("submissions").Select
ActiveSheet.ShowAllData
Columns("H").Select
Range("p1").Activate
Selection.EntireColumn.Hidden = True
Columns("t:v").Select
Range("v1").Activate
Selection.EntireColumn.Hidden = True
ActiveSheet.Range("A:w").AutoFilter Field:=18, Criteria1:="<>"
ActiveSheet.Range("A:w").AutoFilter Field:=23, Criteria1:="<>"
Range("D2:AC2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Workbooks.Open Filename:= _
"S:\4th Floor\SQ Operations\OPs Mi Spreadsheets\Allocation audit tools\Allocation Data\test.xlsx"
Range("a1").Select
xm = Range("A" & Rows.Count).End(xlUp).Row + 1
Range("a" & xm).PasteSpecial xlPasteValues
Any help would ne much appreciate...
when i debug it is highlighting the last line of the code,
Range("a" & xm).PasteSpecial xlPasteValues