Mix relative & absolute reference in VBA code formula ?

jgun84

New Member
Joined
Sep 20, 2017
Messages
2
hey,

need your expertise guys, i have a formula for VBA code below. it returns an error

Code:
Sub test()
Range("Y17").Select




ActiveCell.FormulaR1C1 = "=IF(MAX(RC[2]:RC[14])<=0,""-"",INDEX($AA$15:$AM$15,0,MATCH(MAX(RC[2]:RC[14]),RC[2]:RC[14])))"""
End Sub

I believe the absolute reference causes an error. appreciate your help

Regards,
Jack G
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Re: Help - how to mix relative & absolute reference in VBA code formula ?

Hi. Do you know how to use the macro recorder? Record putting the formula in the cell. Dont forget the absolution. It will give you exactly what you ask for.
 
Upvote 0
Re: Help - how to mix relative & absolute reference in VBA code formula ?

Steve the fish - thanks for prompt reply. Problem solved !
 
Upvote 0

Forum statistics

Threads
1,225,197
Messages
6,183,504
Members
453,165
Latest member
kuldeep08126

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