Subtract two Columns(A-B) result in ColumnC (using Scripting.Dictionary)

marreco

Well-known Member
Joined
Jan 1, 2011
Messages
609
Office Version
  1. 2010
Platform
  1. Windows
hi.

I try learning about Scripting.Dictionary.
My question is:
How subtract two Columns(A-B) result in ColumnC (using Scripting.Dictionary).
Col ACol BCol C
29,0638,05-8,99
19,0925,00-5,91
29,00
37,17-8,17
29,7438,12-8,38
29,0037,17-8,17
25,7634,24-8,48
38,4351,09-12,66
38,4451,09-12,66
39,5552,57-13,02
21,5828,68-7,10
22,5229,93-7,41
114,62148,01-33,39

<colgroup><col style="mso-width-source:userset;mso-width-alt:2194;width:45pt" width="60"> <col style="mso-width-source:userset;mso-width-alt:2230;width:46pt" width="61"> <col style="mso-width-source:userset;mso-width-alt:1865;width:38pt" width="51"> </colgroup><tbody>
</tbody>
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You wouldn't use a dictionary for something like that.
If you want to subtract one value from another with VBA, try
Code:
Sub marreco()
   With Range("C2", Range("B" & Rows.Count).End(xlUp).Offset(, 1))
      .Value = Evaluate("if({1}," & .Offset(, -2).Address & "-" & .Offset(, -1).Address & ","""")")
   End With
End Sub
 
Upvote 0
Hi good, this solved my post
Thank you!!!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,789
Members
449,126
Latest member
Greeshma Ravi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top