i need to turn a dynamic formula, made of a query into a real, working formula somehow. The formula looks as follows:
=INDEX('C:\EXCHANGER\[FracReport.xlsb]ProppantAndFluid'!B57;1;1)
And despite that it starts with "=" it does nothing until i do ctrl+H, replace "=" with "=". The VBA solution that i have found so far:
Dim a As String
Dim b As String
Dim c As String
Sheets("ProppantAndFluid").UsedRange.Replace What:="=", Replacement:="", LookAt:=xlPart
a = "="
b = ActiveSheet.Range("B10").Value
c = a & b
MsgBox c
ActiveSheet.Range("F10") = c
It msgboxes c alright, but when it comes to the actual concatenation of "=" and formula and assigning it to a range, it throws
Run-time error '1004': Application-defined or object-defined error
Any solutions for query obtained formulas, or workarounds for Application, object defined errors, please?
MsgBox c
? – HTHActiveSheet.Range("F10").Formula = c
– Variatus.Value
property is implicitly assumed and it works as.Formula
one, provided theValue
meets formula syntax requirements, of course – HTH