So while looking at this I realized that the workbook doesn't have to be unlocked to copy and paste the values. Eventually I will lock it down so they cannot see locked cells, but that will be later.
When recording the macro here's the code that generates:
Sub Copy2()
'
' Copy2 Macro
' Copy and paste values into new workbook
'
'
Workbooks.Add
Windows("Copy of WR_CPF_3-10-2013.xlsm").Activate
Cells.Select
Selection.Copy
Windows("Book5").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A6:K6").Select
Windows("Copy of WR_CPF_3-10-2013.xlsm").Activate
Sheets("#2 Market Survey").Select
Cells.Select
Range("A2").Activate
Application.CutCopyMode = False
Selection.Copy
Windows("Book5").Activate
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Windows("Copy of WR_CPF_3-10-2013.xlsm").Activate
Sheets("Comp Sheet").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book5").Activate
Sheets("Sheet3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
The problem is it is referencing a specific workbook ("Copy of WR_CPF_3-10-2013.xlsm" and "Book5.xlsx"). This is a weekly report so the file name changes week to week. I need it to recognize the current file name and use that as the "active workbook" and I need to lose the "Book 5" name because it will not always be "Book 5."
Does all this make sense?
Bookmarks