ich brauch mal wieder Eure Hilfe. Wo wäre ich nur ohne Euch. Dank auch an Erich aus KL.
Ich bekomme bei folgendem Makro die Fehlermeldung "Fehler beim Kompilieren,
Sub oder
Function nicht definiert"
Der Begriff, der die Meldung auslöst ist "BOGENMASS". Excel kennt diesen Begriff, also dachte _
ich in VBA müsste es auch klappen. Wo liegt mein Fehler? Muss ich diesen Begriff noch definieren? Wenn ja, wie geht das?
Hier das Makro mal zum anschauen:
Sub Formel_1()
Dim dbla1STRICH As Double, dblb1STRICH As Double
Dim h1STRICH As Double
Dim h2STRICH As Double, mean_hSTRICH As Double, h1STRICH As Double
'--- Teil 1:
With Application.WorksheetFunction
dbla1STRICH = Cells(11, 3)
dblb1STRICH = Cells(12, 3)
'WENN(C12>0;GRAD(ARCTAN2(C11;C12));360+GRAD(ARCTAN2(C11;C12)))
h1STRICH = .Degrees(.Atan2(dblC11, dblC12)) - 360 * (dblC12 > 0)
End With
End Sub
Sub Formel_2()
Dim dbla2STRICH As Double, dblb2STRICH As Double
Dim h1STRICH As Double
Dim h2STRICH As Double, mean_hSTRICH As Double, h1STRICH As Double
'--- Teil 1:
With Application.WorksheetFunction
dbla2STRICH = Cells(20, 3)
dblb2STRICH = Cells(21, 3)
'WENN(C21>0;GRAD(ARCTAN2(C20;C21));360+GRAD(ARCTAN2(C20;C21)))
h2STRICH = .Degrees(.Atan2(dblC20, dblC21)) - 360 * (dblC21 > 0)
End With
End Sub
Public
Function Testmakro_dE2000(ByVal L1 As Double, L2 As Double, a1 As Double, a2 As Double, b1 As _
Double, b2 As Double) As Double
'--- Schritt 1
C1 = (a1 ^ 2 + b1 ^ 2) ^ 0.5
'--- Schritt 2
C2 = (a2 ^ 2 + b2 ^ 2) ^ 0.5
'--- Schritt 3
G = 0.5 * (1 - (((C1 + C2) / 2) ^ 7 / (((C1 + C2) / 2) ^ 7 + 25 ^ 7)) ^ 0.5)
'--- Schritt 4
a1STRICH = (1 + G) * a1
'--- Schritt 5
b1STRICH = b1
'--- Schritt 6
C1STRICH = (a1STRICH ^ 2 + b1STRICH ^ 2) ^ 0.5
'--- Schritt 7
'--- Schritt 8
a2STRICH = (1 + G) * a2
'--- Schritt 9
b2STRICH = b2
'--- Schritt 10
C2STRICH = (a2STRICH ^ 2 + b2STRICH ^ 2) ^ 0.5
'--- Schritt 11
'--- Schritt 12
mean_CSTRICH = (C1STRICH + C2STRICH) / 2
'--- Schritt 13
If Abs(h2STRICH - h1STRICH)