["VBA"] subtracting the same value

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hi, so far this little code work, but when I tried to used with ABS[....] then whatever I did, is not working
VBA Code:
Sub d()
[AB2:AB8909] = [B2:B8909 -AB1]
[AC2:AC8909] = [C2:C8909 - AC1]
[AD2:AD8909] = [D2:D8909 - AD1]
[AE2:AE8909] = [E2:E8909 - AE1]
[AF2:AF8909] = [F2:F8909 - AF1]
End Sub
Please if you can show me a loop for this would be good, and I am looking for the absolute value.
thanks.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
VBA Code:
Sub t()
Dim i As Long, j As Long
    For i = 28 To 32
        For j = 2 To 8909
            Cells(j, i) = Abs(Cells(i - 26, j).Value - Cells(1, i).Value)
        Next
    Next
End Sub
 
Upvote 0
Thank you Mr. FormR, and yes Sir, work for me, I really appreciate the time you spend for me.
 
Upvote 0

Forum statistics

Threads
1,215,062
Messages
6,122,925
Members
449,094
Latest member
teemeren

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