Trouble Setting Desirable Range

ohFice

New Member
Joined
May 30, 2019
Messages
24
Hi,

I am new to new forum, and new to VBA in general. I am trying to create a macro which sets a range of cells equal to themselves divided by a different range of cells, and multiplied by 12. Is this possible? I try to explain what I am trying to do via code that doesn't work below. I genuinely appreciate any assistance!

Sub Annualize()


Range(P59, P450) = Range(P59, P450 / Range(R59, R450)) * 12


End Sub
 

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"
Code:
[P50:P450] = [IFERROR(P50:P450/R50:R450*12,0)]
Or perhaps :
Code:
[P50:P450] = [IFERROR(P50:P450/R50:R450*12,P50:P450)]
 
Last edited:
Upvote 0
I was able to utilize the second line of code you sent with a minor adjustment, see below.
[P50:P450] = [IFERROR(P50:P450/R50:R450*12,P50:P450)]
Thanks, Footoo! :)
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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