Hi All,
Below are certain extracts of my code:
Dim SheetName As String
SheetName = CBO1_Engine.Value
MsgBox SheetName
Range("A1").Select
ActiveCell.FormulaR1C1 = _
"=CONCATENATE(""*testing "",""""""""," & SheetName & "!R[" & xStart & "]C[1],""_""," & SheetName & "!R[" & xStart & "]C[2],""_M=""," & SheetName & "!R[" & xStart & "]C[4],""kg"","""""""","" "","""""""""""","" ""," & SheetName & "!R[183]C[71],)"
The above Code refers to a Concatenate formula I am running in a macro. It refers to two variables, the first being the worksheet 'SheetName' and the second being the Row reference 'xStart'. 'SheetName' is derived from the value of a user selection in a combobox.
It runs however it comes up with an 'update reference' dialog box for the reference for the sheet. If I click cancel it leaves #NAME in the A1 Cell. If I look at the formula that the VBA has input into this cell it is correct apart from the apostrophes that surround the sheet, SheetName. Thus it thinks its just text. If I manually put these apostrophies in the formula works fine. Can someone advise as to how to modify the above to get it to work?
Thanks in Advance
Mark
Bookmarks