vba string assignment. WHy am I getting 1004 run time error? -


on below line in code getting 1004 run time error: application-defined or object-defined error. think might problem on right side of statement. however, i've changed way written few times no avail. can see have tried inserting many character codes. want inserted cell b1, b1 active cell ="'"&a1&"'," spaces clarity: = " ' " &a1& " ' , "

this supposed reference cell a1, take value , put inside single quotes, comma @ end. formatted sql statement.

any appreciated. know common error, error message not helping.

activecell.formula = chr(61) & "'" & chr(34) & chr(38) & "a1" & chr(38) & chr(34) & "'," 

to escape quotes need double them up:

activecell.formula = "=""'"" & a1 & ""',""" 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -