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

B

Benedikt F

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.
 
M

moon

Benedikt F said:
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
 
G

Gordy99

Sub SaveThisAMSheet()
Set ThisBook = Workbooks("dailyinterest2.xlw").Sheets("menu").Activate
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top