ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   R1C1 reference (https://www.excelbanter.com/excel-discussion-misc-queries/260025-r1c1-reference.html)

Rick

R1C1 reference
 
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)



Luke M[_4_]

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

--
Best Regards,

Luke M
"Rick" wrote in message
...
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)





Rick

R1C1 reference
 
Luke the compiler did not like that code format ...

"Rick" wrote:

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)



Dave Peterson

R1C1 reference
 
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.



Rick wrote:

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)


--

Dave Peterson

Rick

R1C1 reference
 
Thank Dave it work like a charm

"Dave Peterson" wrote:

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.



Rick wrote:

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)


--

Dave Peterson
.



All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com