Tom,
i guess what you mean by a fomat statement is:
' assign current data to variables
fee_deducted = Format(Value.Offset(i - 1, 7).Value, "$##.##0")
You have me confused. I thought in order to have the number picked from
excel and placed in word i need to assign current data to veriables?
Anyways here is all my code so that you uderstand what i'm doing.
Sub Makefeestatement()
' creates statments in word using automation
Dim WordApp As Object
' start word and create an object
Set WordApp = CreateObject("Word.Application")
' info from worskheet
Set data = Sheets("sheet1").Range("a1")
Message = Sheets("sheet1").Range("Message")
' cycle through all records in sheet1
Records = Application.CountA(Sheets("sheet1").Range("a:a"))
For i = 1 To Records
' update status bar progress message
Application.StatusBar = "processing record " & i
' assign current data to variables
Port_account = data.Offset(i - 1, 0).Value
For_Qtr_End = data.Offset(i - 1, 1).Value
Port_name = data.Offset(i - 1, 2).Value
Report_date = data.Offset(i - 1, 3).Value
Avg_mnth_end_val = Format(data.Offset(i - 1, 4).Value,
"##,000")
Invst_mnge_fee = Format(data.Offset(i - 1, 5).Value, "##,000")
GST = Format(data.Offset(i - 1, 6).Value, "#,000")
fee_deducted = Format(Value.Offset(i - 1, 7).Value, "$##.000")
' determine the file name
SaveAsName = ThisWorkbook.Path & "\" & Port_account & ".doc"
' send commands to word
With WordApp
.Documents.Add
With .Selection
.typeparagraph
.paragraphformat.Alignment = wdAlignParagraphJustify
.InlineShapes.AddPicture Filename:="C:\Documents and
Settings\rburger\Verity\verity logo\Logos + Branding
Info\fee_logo_testing_color.jpg", _
LinkToFile:=False, SaveWithDocument:=True
.Font.Size = 14
.Font.Bold = True
.paragraphformat.Alignment = wdAlignParagraphJustify
.TypeText Text:=vbTab & "Quarterly Statement of Fees"
.typeparagraph
.typeparagraph
.typeparagraph
.typeparagraph
.Font.Size = 11
.paragraphformat.Alignment = 0
.Font.Bold = False
.paragraphformat.Alignment = wdAlignParagraphRight
.TypeText Text:="Report Date:" & vbTab & vbTab & vbTab &
vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab & vbTab &
Format(Date, "mmmm d, yyyy")
.typeparagraph
.typeparagraph
.TypeText Text:="For the Quarter Ending: " & vbTab &
vbTab & vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab & For_Qtr_End
.typeparagraph
.typeparagraph
.TypeText Text:="Portfolio Name:" & vbTab & vbTab &
vbTab & vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab & vbTab & Port_name
.typeparagraph
.typeparagraph
.TypeText Text:="Portfolio Account:" & vbTab & vbTab &
vbTab & vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab & Port_account
.typeparagraph
.typeparagraph
.TypeText Text:="Average Month End Portfolio Value:" &
vbTab & vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab &
Format(Avg_mnth_end_val, "$#,##.00")
.typeparagraph
.typeparagraph
.TypeText Text:="Investment Management & Custody Fee:" &
vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab &
Format(Invst_mnge_fee, "$#,#.00")
.typeparagraph
.typeparagraph
.TypeText Text:="G.S.T at 7% (Reg:# unknown):" & vbTab &
vbTab & vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab & Format(GST,
"$#,#.00")
.typeparagraph
.typeparagraph
.Font.Underline = wdUnderlineSingle
.TypeText Text:="Fee to be Deducted from Account:" &
vbTab & vbTab & vbTab _
& vbTab & vbTab & vbTab & vbTab &
Format(fee_deducted, "$##.##0")
.typeparagraph
.typeparagraph
.typeparagraph
.TypeText Message
.typeparagraph
.typeparagraph
End With
.ActiveDocument.SaveAs Filename:=SaveAsName
' .ActiveWindow.Close
End With
Next i
' kill the object
WordApp.Quit
Set WordApp = Nothing
' reset status bar
Application.StatusBar = ""
MsgBox Records & " fees were created and saved in " &
ThisWorkbook.Path
End Sub