Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA- Concatenation Problem

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
Using Excel 2003 and trying to insert a formula into a cell but can't get the concatenation right in the VB Editor.

This is the formula I want to be inserted:
=IF(Sheet1!A1="","",Sheet1!A1)

My current code:
ActiveCell.Formula= _
"=IF(Sheet1'A1=," & "" & "," & "" & "," & "Sheet1!A1)"

Thanks.
 


hi,

VBA questions are best addressed in forum707.

That being said, why do you need to concatenate???

As far as the QUOTES
Code:
'=IF(Sheet1!A1="","",Sheet1!A1)
ActiveCell.Formula = "=IF(Sheet1!A1="""","""",Sheet1!A1)"

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks Skip! That worked.

Sorry for posting in the wrong forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top