Beginner35
New Member
- Joined
- Dec 9, 2013
- Messages
- 10
Hello, i have been so frustrated with this below:
I have about 100 files and they all have this tab call "Oracle". Some of the file the "Oracle" tab is protected, some are not protected, some are protected with a password call 'ch'. My co-worker and I have been working on this issue but doesn't seem to able to find a simple solution. The end goal is to un-protect this Oracle sheet within a file doesn't matter there is password or no password or not protected to begin with and copy and paste the data on that tab into a new file. Please help!!!!
Sub Pickle()
Dim helen As Workbook
Dim helen2 As Workbook
Set helen2 = Workbooks.Add
Set helen = Workbooks.Open("h:\2014 Baseline\2014_13512 Chief Architect.xlsm")
helen.Activate
helen.Sheets("Oracle").Visible = True
helen.Sheets("Oracle").Unprotect Password:="ch"
Range("a5:au1228").AutoFilter Field:=29, Criteria1:="y"
Range("a5:au1228").Copy helen2.Sheets(1).Range("a5")
End Sub
I have about 100 files and they all have this tab call "Oracle". Some of the file the "Oracle" tab is protected, some are not protected, some are protected with a password call 'ch'. My co-worker and I have been working on this issue but doesn't seem to able to find a simple solution. The end goal is to un-protect this Oracle sheet within a file doesn't matter there is password or no password or not protected to begin with and copy and paste the data on that tab into a new file. Please help!!!!
Sub Pickle()
Dim helen As Workbook
Dim helen2 As Workbook
Set helen2 = Workbooks.Add
Set helen = Workbooks.Open("h:\2014 Baseline\2014_13512 Chief Architect.xlsm")
helen.Activate
helen.Sheets("Oracle").Visible = True
helen.Sheets("Oracle").Unprotect Password:="ch"
Range("a5:au1228").AutoFilter Field:=29, Criteria1:="y"
Range("a5:au1228").Copy helen2.Sheets(1).Range("a5")
End Sub