Macro Recorder Question

Nalani

Well-known Member
Joined
Apr 10, 2009
Messages
1,047
When using the Recorder to help me, I get the following:

Code:
 Range("K15").Select
    ActiveCell.FormulaR1C1 = "=IF(R[3]C[-9]=RC[2],1,0)"
    Range("K16").Select

I do understand what the R1C1 is saying but -

I don't particually like the R1C1 annotation and would prefer to reference the actual cells when writing my code.

How can I (if possible) set the recorder so it will give me:

Code:
=IF(B18=M15,1,0)
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Unselect Use relative references
 
Upvote 0
Try clicking the Office Button in the upper left of Excel, click Excel Options located on bottom of the popup page, click formulas, uncheck R1C1 reference style in "Working with formulas.

Chuck
 
Upvote 0
Thanks for the quick replies guys:

shg - I tried Both ways still the same thing

chuck - R1C1 is not checked
 
Upvote 0
I try closing and reloading your Excel file and make sure R1C1 not checked. If still not working, perhaps re-booting computer and trying again. If still unchecked and bad, maybe Excel is corrupted??

Can't figure what else it might be...
 
Upvote 0
Reletive Reference Unchecked gives:

Code:
 ActiveCell.FormulaR1C1 = "=IF(R[3]C[-9]=RC[2],1,0)"
    Range("K16").Select

CHECKED gives:

Code:
ActiveCell.FormulaR1C1 = "=IF(R[3]C[-9]=RC[2],1,0)"
    ActiveCell.Offset(1, 0).Range("A1").Select


EDIT: I might add that the line where it says "A1".select - never happens.
All I did was record the formula and press enter, which brought the cursor down one row.
 
Last edited:
Upvote 0
I try closing and reloading your Excel file and make sure R1C1 not checked. If still not working, perhaps re-booting computer and trying again. If still unchecked and bad, maybe Excel is corrupted??

Can't figure what else it might be...

I did close and reopen the File. same thing.

I doubt that my Excel is corrpt.
 
Upvote 0
Since you are using the macro recorder, how are you getting that formula into the macro?

Could you cut and paste the full macro the recorder generates here? Including Sub, End Sub.

Thanks.
 
Upvote 0
I apologize, Nalani, I misunderstood your question.
 
Upvote 0
One of my customers just called, so gotta run for a few hours. I'll check back then as am curious about possible solution there.

Chuck
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,707
Members
452,939
Latest member
WCrawford

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