-
Now that I have a worksheet to work with.....
I am posting the code also just because it is taking about 3 minutes between clicking the submit till something happens.
[VBA]
Option Explicit
Sub AddPara(iInfo As String, iRow As Long, iCol As Long)
Dim mData() As String, mTotal As Double, Percent As String
Dim mI As Long
mData = Split(iInfo, "(")
If UBound(mData) > 0 Then
For mI = LBound(mData, 1) + 1 To UBound(mData, 1)
mTotal = mTotal + Val(mData(mI))
Next
ActiveSheet.Cells(iRow, 19).Value = mTotal
For mI = LBound(mData, 1) + 1 To UBound(mData, 1)
Percent = Percent & "|" & Format(Val(mData(mI)) / mTotal, "0.00%")
Next
ActiveSheet.Cells(iRow, 20).Value = Mid(Percent, 2)
End If
End Sub
Sub Test()
Dim mI As Long, mN As Long
mI = ActiveSheet.UsedRange.Rows.Count
For mN = 1 To mI
If ActiveSheet.Cells(mN, 10).Value > "" Then
AddPara ActiveSheet.Cells(mN, 10), mN, 10
End If
Next
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules