DaynaBarnes
New Member
- Joined
- Jul 22, 2013
- Messages
- 3
Hi all--I have the need to save only the values from one sheet of a workbook, as .csv in a new workbook that is named according to the value in cell A2. The sheet is populated according to formulas. I have a nice, simple VBA doing everything right...except it copies the formulas over, and the end users won't have access to the generator. Could someone please help me figure out the simplest way to get ONLY the values into my new file?
Here's the existing code:
Sub CopyFile2()
'
' CopyFile Macro
'
'
Dim FileName As String
Dim Path As String
Application.DisplayAlerts = False
FileName = Range("A2").Value
Sheets("CSVfile").Select
Sheets("CSVfile").Copy
Sheets("CSVfile").Select
ChDir "P:"
ActiveWorkbook.SaveAs FileName:="P:" & FileName, FileFormat:=xlCSV, _
CreateBackup:=False
End Sub
Here's the existing code:
Sub CopyFile2()
'
' CopyFile Macro
'
'
Dim FileName As String
Dim Path As String
Application.DisplayAlerts = False
FileName = Range("A2").Value
Sheets("CSVfile").Select
Sheets("CSVfile").Copy
Sheets("CSVfile").Select
ChDir "P:"
ActiveWorkbook.SaveAs FileName:="P:" & FileName, FileFormat:=xlCSV, _
CreateBackup:=False
End Sub