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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,223,738
Messages
6,174,207
Members
452,551
Latest member
croud

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