Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Is it possible to have a button on a worksheet which
would output an excel file or a word file with just that sheets information on it? A lot of the cells contain formaulas. Also how can I get the button to call the file by the worksheet tab name |
#2
![]() |
|||
|
|||
![]()
Maybe something like:
Option Explicit Sub testme01() Dim newWks As Worksheet ActiveSheet.Copy 'to a new workbook Set newWks = ActiveSheet 'in that new workbook With newWks .Buttons.Delete .Parent.SaveAs Filename:=ThisWorkbook.Path & "\" & .Name & ".xls", _ FileFormat:=xlWorkbookNormal .Parent.Close savechanges:=False End With End Sub Pete wrote: Is it possible to have a button on a worksheet which would output an excel file or a word file with just that sheets information on it? A lot of the cells contain formaulas. Also how can I get the button to call the file by the worksheet tab name -- Dave Peterson |
#3
![]() |
|||
|
|||
![]()
Dave,
It is great, the filename layout works just right. The sheet contains formulas though and they are linked. I need to be able to send the file by email to someone without security access to the main file. The values need to be there and not an option to update values. Thanks. Pete -----Original Message----- Maybe something like: Option Explicit Sub testme01() Dim newWks As Worksheet ActiveSheet.Copy 'to a new workbook Set newWks = ActiveSheet 'in that new workbook With newWks .Buttons.Delete .Parent.SaveAs Filename:=ThisWorkbook.Path & "\" & .Name & ".xls", _ FileFormat:=xlWorkbookNormal .Parent.Close savechanges:=False End With End Sub Pete wrote: Is it possible to have a button on a worksheet which would output an excel file or a word file with just that sheets information on it? A lot of the cells contain formaulas. Also how can I get the button to call the file by the worksheet tab name -- Dave Peterson . |
#4
![]() |
|||
|
|||
![]()
You could do a copy|paste special|values (in code) or something like this
Option Explicit Sub testme01() Dim newWks As Worksheet ActiveSheet.Copy 'to a new workbook Set newWks = ActiveSheet 'in that new workbook With newWks .Buttons.Delete With .UsedRange .Value = .Value End With .Parent.SaveAs Filename:=ThisWorkbook.Path & "\" & .Name & ".xls", _ FileFormat:=xlWorkbookNormal .Parent.Close savechanges:=False End With End Sub With .UsedRange .Value = .Value End With could be: .Cells.Copy .Cells.PasteSpecial Paste:=xlPasteValues Depending on how you feel <bg. Pete wrote: Dave, It is great, the filename layout works just right. The sheet contains formulas though and they are linked. I need to be able to send the file by email to someone without security access to the main file. The values need to be there and not an option to update values. Thanks. Pete -----Original Message----- Maybe something like: Option Explicit Sub testme01() Dim newWks As Worksheet ActiveSheet.Copy 'to a new workbook Set newWks = ActiveSheet 'in that new workbook With newWks .Buttons.Delete .Parent.SaveAs Filename:=ThisWorkbook.Path & "\" & .Name & ".xls", _ FileFormat:=xlWorkbookNormal .Parent.Close savechanges:=False End With End Sub Pete wrote: Is it possible to have a button on a worksheet which would output an excel file or a word file with just that sheets information on it? A lot of the cells contain formaulas. Also how can I get the button to call the file by the worksheet tab name -- Dave Peterson . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) | |||
Copy formula...sheet 2 sheet | New Users to Excel | |||
Is it possible to recover a deleted sheet after saving the file? | Excel Discussion (Misc queries) | |||
Hyperlink to specific sheet in Excel Web File | Links and Linking in Excel | |||
Naming & renaming a sheet tab | Excel Worksheet Functions |