ich habe eine Frage hinsichtlich meiner If-Eingabe in VBA, die da wie folgt lautet:
Option Explicit
Public Function GewB1(tw As Variant, t1 As Double, d1 As Double, a1 As Variant, Gamma As Double, _
Gammaw As Double) As Double
Dim vb1 As Double
If a1 = "d1 =" Then
vb1 = WorksheetFunction.Pi * d1 ^ 2 / 4 * t1
If a1 = "a1 =" Then
vb1 = d1 ^ 2 * t1
If (tw >= t1) And (tw = "-") Then
GewB1 = vb1 * Gamma
If (tw
Ich möchte mit dieser Eingabe erreichen, dass vb1 unterschiedlich errechnet wird abhängig von der Zelle a1. Im zweiten Schritt soll dann GewB1 entsprechend den if-Anweisungen errechnet werden.Leider bekomme ich nach dem Kompilieren die Fehlermeldung: " Fehler beim Kompilieren: If-Block ohne End If ". Diese Meldung verstehe ich nicht, da ein End If von mir eingebaut wurde.
Danke schon mal für eure Hilfe.