Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Well, I recorded a macro but it is not working correctly. It is as followed:

Sub OpenCase1()
'
' OpenCase1 Macro
'

'
    Range("G5").Select
    ActiveCell.FormulaR1C1 = "=R[-4]C[-3]"
    Range("G5").Select
End Sub

It's a simple command, I thought, but obviously it is not working. What I want it to do is, when clicking the macro, it will change cell G5 to =D1, copying the contents of cell D1. From previous help I have gotten, the Select parts in the macro may be a problem, however it might not be the case in this.

All help is rather appreciated, please help :)

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Simplify the code by accessing the cell directly without Select

Range("G5").Value = "=D1"

or

Range("G5").Formula = "=D1"

or if you want to use your notation for some other reason

Range("G5").FormulaR1C1 = "=R[-4]C[-3]"
share|improve this answer
    
Heh Heh, or I could have done that. Thank you Amer. :) –  Mordecaii Apr 23 '13 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.