Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First of all, thanks!
Just one more question, how to (in SaveWorksheetAsNewWorkbook() ) convert (format?) all cells as values not formulas with links? Somewhere in this part of code...? Thanks '--------------------------- Private Sub SaveWorksheetAsNewWorkbook() Dim strSavePath As String Dim strSaveName As String strSavePath = "K:\" Dim wkb As Workbook With ThisWorkbook.Sheets("Sheet1") strSaveName = "Name" strSaveName = strSaveName & _ Format(.Range("A1").Text, "0000") strSaveName = strSaveName & ".xls" .Copy End With Set wkb = ActiveWorkbook wkb.SaveAs Filename:= _ strSavePath & strSaveName, _ FileFormat:=xlNormal wkb.Close End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this:
'--------------------------- Private Sub SaveWorksheetAsNewWorkbook() Dim strSavePath As String Dim strSaveName As String strSavePath = "K:\" Dim wkb As Workbook With ThisWorkbook.Sheets("Sheet1") strSaveName = "Name" strSaveName = strSaveName & _ Format(.Range("A1").Text, "0000") strSaveName = strSaveName & ".xls" .Copy End With Set wkb = ActiveWorkbook ActiveSheet.Cells.Copy ActiveSheet.Cells(1, 1).PasteSpecial xlPasteValues Application.CutCopyMode = False ActiveSheet.Cells(1, 1).Select wkb.SaveAs Filename:= _ strSavePath & strSaveName, _ FileFormat:=xlNormal wkb.Close End Sub Bob Kilmer "Davor Zupanic" wrote in message ... First of all, thanks! Just one more question, how to (in SaveWorksheetAsNewWorkbook() ) convert (format?) all cells as values not formulas with links? Somewhere in this part of code...? Thanks '--------------------------- Private Sub SaveWorksheetAsNewWorkbook() Dim strSavePath As String Dim strSaveName As String strSavePath = "K:\" Dim wkb As Workbook With ThisWorkbook.Sheets("Sheet1") strSaveName = "Name" strSaveName = strSaveName & _ Format(.Range("A1").Text, "0000") strSaveName = strSaveName & ".xls" .Copy End With Set wkb = ActiveWorkbook wkb.SaveAs Filename:= _ strSavePath & strSaveName, _ FileFormat:=xlNormal wkb.Close End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet to new file | Excel Discussion (Misc queries) | |||
copy part of a worksheet into a worksheet in the same file/keepi. | Excel Worksheet Functions | |||
Saving worksheet in new file with date AND cell value as file name | Excel Discussion (Misc queries) | |||
How to get file name on a worksheet? | New Users to Excel | |||
open file dialog-select file-import worksheet | Excel Programming |