ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro that saves Excel worksheet with value in C4 as the file name (https://www.excelbanter.com/excel-programming/374093-macro-saves-excel-worksheet-value-c4-file-name.html)

Benedikt F

Macro that saves Excel worksheet with value in C4 as the file name
 
Hi

I have been asked to create an Excel invoice form and I want to create macro
that saves the worksheet. I want the macro to use the value in C4 (invoice
number) as the name for the Excel invoice. I hope someone can help me with
this.

best regards,
Benedikt F.
Iceland Seafood Int.



moon[_7_]

Macro that saves Excel worksheet with value in C4 as the file name
 

"Benedikt F" schreef in bericht
...
Hi

I have been asked to create an Excel invoice form and I want to create
macro that saves the worksheet. I want the macro to use the value in C4
(invoice number) as the name for the Excel invoice. I hope someone can
help me with this.

best regards,
Benedikt F.
Iceland Seafood Int.




Public Sub SaveAsC4()
ThisWorkbook.SaveAs Cells(4, 3).Value
End Sub




Gordy99

Macro that saves Excel worksheet with value in C4 as the file name
 
Sub SaveThisAMSheet()
Set ThisBook = Workbooks("dailyinterest2.xlw").Sheets("menu").Act ivate
Workbooks("dailyinterest2.xlw").Sheets("amtest.xls ").Activate
Investsheet.Value = ""
ChDir "c:\my documents\excel\dailyinterest2\contract"
Set GetTheSheet = Range("d4")
Sheets("amtest.xls").Select
Sheets("amtest.xls").Copy
With ActiveWorkbook
.Title = "Contract Number " & Range("d4")
.Subject = "Last payment was made " & Range("b436")
.Author = ""
.Keywords = "Payer is " & Range("d5") & ". Investor is " &
Range("d6") & "."
.Comments = "Loan is $" & Format(Range("d8"), "#,###.00") & " at
" & Format(Range("d11"), "0.00%") & " for " & Range("d9") & " months." &
Chr(13) & "The Investor's yeild is " & Format(Range("j4"), "0.00%") & "." &
Chr(13) & " Balloon is $" & Format(Range("g12"), "#,###.00") & "." & "The
Total Accrued is $" & Format(Range("f436"), "#,###.00")
End With
Range("t1") = "contract"
ActiveWorkbook.SaveCopyAs GetTheSheet & ".xls"
ActiveWindow.Close saveChanges:=False
'ThisBook.Activate
End Sub

"Benedikt F" wrote:

Hi

I have been asked to create an Excel invoice form and I want to create macro
that saves the worksheet. I want the macro to use the value in C4 (invoice
number) as the name for the Excel invoice. I hope someone can help me with
this.

best regards,
Benedikt F.
Iceland Seafood Int.





All times are GMT +1. The time now is 05:37 PM.

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