working with arrays - VBA

T

Tony

please help my mentor asked me to complete something. we are reading a line
from a file and print the date and the amount in a table, we store the info
in an array. below is a sample to write the date and the corresponding
amount..for a selected range of dates. What I'm struggling to do is to add
the final total on the last cell

cntCell = 2
For cnt = LBound(arrTotal) To UBound(arrTotal)
ActiveDocument.Tables(1).Columns(1).Cells(cntCell).Range.Text =
Mid(arrSum(cnt), 1, InStr(1, arrSum(cnt), " ") - 1)
ActiveDocument.Tables(1).Columns(1).Cells(cntCell).Range.Bold = False
ActiveDocument.Tables(1).Columns(2).Cells(cntCell).Range.Text =
Format(Mid(arrSum(cnt), InStr(1, arrSum(cnt), " ") + 1), "### ### ##0.00")
ActiveDocument.Tables(1).Columns(2).Cells(cntCell).Range.Bold = False
cntCell = cntCell + 1
Next cnt
Erase arrSum

/*where arrSum(cnt) = "Feb-03 12604.25")
the date and the amount*/

please assist with the code
 

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