Is There A Way To Subtract From VBA Range?

aedctalk

Board Regular
Joined
Oct 9, 2010
Messages
156
For the below code.. i'm wanting to do something like RangeJ40-8

Is that possible at all? how would i put that in?

If tried doing L40 as J40-8 and then putting L40 in here.. but that doesnt work.. So is there an alternative way? like withinin this vba?

Thanks so much!! :)

Code:
       If Not Intersect(Target, Range("J40")) Is Nothing Then
     Application.Run "BOWSER.xls!Unprotect"
        Call hideColumns2
        Application.Run "BOWSER.xls!Protect"
    End If
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What do you mean J40 - 8?

do you mean J32?

Or if J32's value is 100, then 92?

If you mean J40-8 is J32, use Offset

Range("J40").Offset(-8,0)
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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