View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gordy99 Gordy99 is offline
external usenet poster
 
Posts: 13
Default 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.