D
De Vo
Hi All
Can I ask some assistance with this one.
Basically I have taken a number and used the formatcurrency() function
to change in my table
156.34 to £156.34
this happends for each cell in my table.
I now need to do a caculation at the end with some of the columns which
included testing for the type of calculation dependant on value
but i am struggling to find a way to remove the formating from the
value or returning the value from the cell to be able to create a
caculation
Dim strCellValue As String
Dim strSubTotal As String
Dim strTempStore As string
Dim intTableRow As Integer
For intTableRow = 2 To ActiveDocument.Tables(1).Rows.Count
strTempStore = .Cell(intTableRow, 3).Range.Text
strTempstore = val(Tempstore)
strSubTotal = Val(strSubTotal) + strTempstore
Next
strSubTotal = FormatCurrency(strSubTotal,2,vbtrue,vbfalse,vbtrue)
ActiveDocument.Tables(2).Cell(1,2).Range.Text = strSubTotal
but I seem to be having problems is there a better way to do what I am
doing ?
please advise with all and any possibilites
Many thanks
De Vo
Can I ask some assistance with this one.
Basically I have taken a number and used the formatcurrency() function
to change in my table
156.34 to £156.34
this happends for each cell in my table.
I now need to do a caculation at the end with some of the columns which
included testing for the type of calculation dependant on value
but i am struggling to find a way to remove the formating from the
value or returning the value from the cell to be able to create a
caculation
Dim strCellValue As String
Dim strSubTotal As String
Dim strTempStore As string
Dim intTableRow As Integer
For intTableRow = 2 To ActiveDocument.Tables(1).Rows.Count
strTempStore = .Cell(intTableRow, 3).Range.Text
strTempstore = val(Tempstore)
strSubTotal = Val(strSubTotal) + strTempstore
Next
strSubTotal = FormatCurrency(strSubTotal,2,vbtrue,vbfalse,vbtrue)
ActiveDocument.Tables(2).Cell(1,2).Range.Text = strSubTotal
but I seem to be having problems is there a better way to do what I am
doing ?
please advise with all and any possibilites
Many thanks
De Vo