K
Kristof
Hi,
How can I put a variable from a macro in a formula
I have the following VBA code
Dim Lijst As Range
y = (ActiveWorkbook.Sheets.Count - 5) * 3
Set Lijst = Worksheets("Gemiddelden+reproduceerbaarheid").Range("a3:h" & 3 +
y)
Resultaat = "=Application.WorksheetFunction.DGet(Lijst, 3,
Range("R100:S101"))"
Range("r3").Formula = "=IF(S5="""",""""," & Resultaat & ")"
It gives the following error message for the last line:
Run-time error '1004':
Application-definedor obect-defined error.
The result for Resultaat is good but apparently it is a problem with
combining the formula.
I know that you can use the If.. then .. else Statement but this formula is
the beginning of a much more complex formula.
Many Thanks for your help.
How can I put a variable from a macro in a formula
I have the following VBA code
Dim Lijst As Range
y = (ActiveWorkbook.Sheets.Count - 5) * 3
Set Lijst = Worksheets("Gemiddelden+reproduceerbaarheid").Range("a3:h" & 3 +
y)
Resultaat = "=Application.WorksheetFunction.DGet(Lijst, 3,
Range("R100:S101"))"
Range("r3").Formula = "=IF(S5="""",""""," & Resultaat & ")"
It gives the following error message for the last line:
Run-time error '1004':
Application-definedor obect-defined error.
The result for Resultaat is good but apparently it is a problem with
combining the formula.
I know that you can use the If.. then .. else Statement but this formula is
the beginning of a much more complex formula.
Many Thanks for your help.