VBA codes to convert number value in column D to negative based on corresponding Text in column B

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
698
Office Version
  1. 2010
Platform
  1. Windows
Can someone post VBA codes to convert number value in column D to negative if corresponding text in column B contains the word Credit or Payment.

Book1
ABCDE
1DateDescriptionClassCostCost to date
207/01/23Charge - RUBS Debra24.49(2,285.85)
307/01/23Credit - Valet Trash - Debra(9.07)(2,310.34)
406/02/23Payment - eCheck Mike(1,117.97)(2,301.27)
506/01/23Credit - RUBS - Electric - Debra(70.09)(1,183.30)
606/01/23Charge - RUBS - Electric - Debra32.57(1,113.21)
706/01/23Credit - Valet Debra(25.58)(1,145.78)
805/02/23Payment - eCheck Mike(1,132.58)(1,120.20)
905/01/23Charge - RUBS Debra12.3812.38
Sheet1
Cell Formulas
RangeFormula
E2:E9E2=E3+D2


Thank you.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,216,174
Messages
6,129,296
Members
449,498
Latest member
Lee_ray

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