Insert " " into a string
You can also use Chr() to insert spaces:
Sub MakeSpace
Range("A1").Value = "Make" & Chr(32) & "space"
Range("A2").Value = "Make" & Chr(vbKeySpace) & "space"
End Sub
vbKeySpace is the VBA constant for the Space key.
Mark Lincoln
On Jun 12, 9:16 am, CWillis wrote:
I am inserting formulas into cells using a macro. Several formulas require a
blank. (" ")
Ex1: Sheets("Frame 6").Range("G3").Value = "=IF(ISERROR(VLOOKUP(A3," &
CSpath & ",29,FALSE))," ",VLOOKUP(A3," & CSpath & ",29,FALSE))"
Ex2: Sheets("Frame 6").Range("F3").Value = "=IF(D3=1,VLOOKUP(A3," & CSpath &
",34,FALSE)," ")"
However, Excel won't let you do this. How can I get the blanks in there?
Thanks in advance.
-Chris
|