N
NFL
Below is a code that works great and what it does is that it exports a
worksheet from the current workbook to a new workbook. The problem I'm
having is that I only want to copy the values and leave the formulas and
references behind. Any help would be appreciated.
Thank you for your help!
Dim message As String
Set MyComputer = CreateObject("Scripting.FileSystemObject")
FolderName1 = Range("F6")
FileName1 = Range("M6")
If MyComputer.FolderExists(FolderName1) = False Then
message = MsgBox("The directory: " & FolderName1 & ", does not
exist." & Chr(10) _
& "Enter a new directory path (cell F6).", 0, "Not today my friend.")
Else
If MyComputer.FileExists(FileName1) = True Then
message = MsgBox("The file name: " & FileName1 & ", already
exists." & Chr(10) _
& "A copy of this file has NOT been saved.", 0, "Not today my
friend.")
Else
'FolderName1 = Application.GetSaveAsFilename(, "Microsoft Excel
Workbook (*.xls), *.xls")
Sheet18.Visible = xlSheetVisible
Sheets("Export").Copy
ActiveWorkbook.SaveAs Filename:=FileName1, FileFormat:=xlNormal
'ActiveWorkbook.SaveCopyAs FileName1
'Range("H1") = "I've Been Exported"
ActiveWindow.Close
End If
End If
worksheet from the current workbook to a new workbook. The problem I'm
having is that I only want to copy the values and leave the formulas and
references behind. Any help would be appreciated.
Thank you for your help!
Dim message As String
Set MyComputer = CreateObject("Scripting.FileSystemObject")
FolderName1 = Range("F6")
FileName1 = Range("M6")
If MyComputer.FolderExists(FolderName1) = False Then
message = MsgBox("The directory: " & FolderName1 & ", does not
exist." & Chr(10) _
& "Enter a new directory path (cell F6).", 0, "Not today my friend.")
Else
If MyComputer.FileExists(FileName1) = True Then
message = MsgBox("The file name: " & FileName1 & ", already
exists." & Chr(10) _
& "A copy of this file has NOT been saved.", 0, "Not today my
friend.")
Else
'FolderName1 = Application.GetSaveAsFilename(, "Microsoft Excel
Workbook (*.xls), *.xls")
Sheet18.Visible = xlSheetVisible
Sheets("Export").Copy
ActiveWorkbook.SaveAs Filename:=FileName1, FileFormat:=xlNormal
'ActiveWorkbook.SaveCopyAs FileName1
'Range("H1") = "I've Been Exported"
ActiveWindow.Close
End If
End If