R1C1 reference

R

Rick

Can anyone tell me the proper structure for thid statement?

ActiveCell.FormulaR1C1 =
"=IF(TagNmeMe.value!RC[-1]="""","""",TagNmeMe.value!RC[-1])"

TagNmeMe is a string that has the stored Sheet Name .

if(sheet1!A5="","",sheet1!A5)
 
L

Luke M

ActiveCell.FormulaR1C1 = _
"=IF(" & TagNmeMe.value & "!RC[-1]="""",""""," & TagNmeMe.value & "!RC[-1])"
 
D

Dave Peterson

If tagnmeme is really a string, then it doesn't have any properties (like
..value).

ActiveCell.FormulaR1C1 _
= "=IF('" & TagNmeMe & "'!RC[-1]="""",""""," & "'" & TagNmeMe & "'!RC[-1])"

Sometimes, the sheet name has to be surrounded by apostrophes (if the sheet name
in a number or looks like an address or contains spaces or ...).

If you supply them and they aren't needed, excel won't care. But if you don't
supply them and you do need them, excel will yell.


Can anyone tell me the proper structure for thid statement?

ActiveCell.FormulaR1C1 =
"=IF(TagNmeMe.value!RC[-1]="""","""",TagNmeMe.value!RC[-1])"

TagNmeMe is a string that has the stored Sheet Name .

if(sheet1!A5="","",sheet1!A5)
 
R

Rick

Thank Dave it work like a charm

Dave Peterson said:
If tagnmeme is really a string, then it doesn't have any properties (like
..value).

ActiveCell.FormulaR1C1 _
= "=IF('" & TagNmeMe & "'!RC[-1]="""",""""," & "'" & TagNmeMe & "'!RC[-1])"

Sometimes, the sheet name has to be surrounded by apostrophes (if the sheet name
in a number or looks like an address or contains spaces or ...).

If you supply them and they aren't needed, excel won't care. But if you don't
supply them and you do need them, excel will yell.


Can anyone tell me the proper structure for thid statement?

ActiveCell.FormulaR1C1 =
"=IF(TagNmeMe.value!RC[-1]="""","""",TagNmeMe.value!RC[-1])"

TagNmeMe is a string that has the stored Sheet Name .

if(sheet1!A5="","",sheet1!A5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top