
Originally Posted by
Ken Puls
Hi Antony,
To copy from one workbook to another, you can use:
Code:
Workbooks("Source Workbook Name.xlsx").Worksheets("My Sheet").Range("A1:B15").Copy
Workbooks("Destination Workbook name.xlsx").Worksheets("Target Sheet").Range("G5").PasteSpecial Paste:=xlPasteAll 'or xlPasteValues
That is written in the browser and untested, but it looks right to my sleepy eyes.
FYI, I may not be online until after the weekend, as we're away celebrating a family birthday. Any chances I do get to check in will be sporadic.
Ken
I spoke too soon, I thought last night at 2.00am I had it completed and in the morning I am still getting errors.
Code:
Sub deleterows()
Sheets("DATASHEET").Select
Application.ScreenUpdating = False
Cells.Select
Range("B1").Activate
Selection.EntireColumn.Hidden = False
Range("A4:Z1077").Select
Selection.AutoFilter
ActiveSheet.Range("$A$4:$Z$1077").AutoFilter Field:=2, Criteria1:="="
Rows("20:1077").Select
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=-15
Range("B65").Select
ActiveSheet.Range("$A$4:$Z$64").AutoFilter Field:=2
Selection.AutoFilter
Columns("A:A").Select
Selection.EntireColumn.Hidden = True
Columns("C:C").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
Columns("N:N").Select
Selection.EntireColumn.Hidden = True
Columns("P:P").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
Columns("T:Y").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 2
Range("B5").Select
With Range("b5")
Range(.Cells(1, 1), .End(xlDown).Cells(1, 25)).Copy
Range("B5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Paste
End With
With Range("b2")
Range(.Cells(1, 1), .End(xlDown).Cells(1, 25)).Copy
End With
Sheets("ACCOUNTSPAGE").Select
End Sub
it gets to this part and falls down
Code:
Selection.EntireColumn.Hidden = False
It says unable to set the hidden property of the range class. I think this is due to the page being protected. I have tried to enter this information at various places but still cannot get it to work.
Code:
With Sheets("DATASHEET")
.unprotect Password:="password"
CODE
.protect Password:="password"
End With
The worse part is I sent it to my boss as completed because I thought it was.
I would really appreciate any help.
Bookmarks