ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs (https://www.excelbanter.com/excel-programming/364343-saveas.html)

Duncan[_6_]

SaveAs
 
I have the following and would like the sheet to be saved by combining two
cell values in the active sheet.

Can anyone Help?

Many thanks
Dunc

Sub PrintandSave()

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox "Your document has been printed. Click OK To Copy Memo to A New
Sheet, You can then save the Memo From Here", vbInformation, "HEAD OFFICE -
Payroll Documents"
Range("B2:M34").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").Select
ActiveSheet.SaveAs Filename:="U:\"cell e10" & "cell e12".xls


pianoman[_58_]

SaveAs
 

hi Duncan,
In the last line, your quotes are a bit mixed up... I would also name
the two elements before using them...

it should read something like...
first = Range("E10")
second = Range("E12")
ActiveSheet.SaveAs Filename:="U:\" & first & second & ".xls"

Try that...

Regards,

Gareth,

Duncan Wrote:
I have the following and would like the sheet to be saved by combining
two
cell values in the active sheet.

Can anyone Help?

Many thanks
Dunc

Sub PrintandSave()

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox "Your document has been printed. Click OK To Copy Memo to A New
Sheet, You can then save the Memo From Here", vbInformation, "HEAD
OFFICE -
Payroll Documents"
Range("B2:M34").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").Select
ActiveSheet.SaveAs Filename:="U:\"cell e10" & "cell e12".xls



--
pianoman
------------------------------------------------------------------------
pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
View this thread: http://www.excelforum.com/showthread...hreadid=552163



All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com