Hi!
This will be my first post to bear with me. I've ran into an odd problem that I hope someone has a solution to.
I have a module that call several other moduels. The module works without errors. However, once i assign an Excel button to the macro and click it I get the following error:
runtime error 438 : Object doesn't support this property or method
and the following line inside one of the modules is highlighted:
FTH = CInt(Evaluate(FTH))
If i try to execute the macro again, but not by using the button, I get the same error. In other words, what worked fine before adding the button doesn't work any longer.
I'm just learning vba and I know that the macro isn't pretty so i'm not surprised that I get an error but I'm surprised it seems to work just fine before adding the button. If someone could explain why this is, or make my code a bit more elegant to bypass the issue, that would be much appreciated.
This is the macro that's giving me an error:
Short explanation: I'm gathering football fixtures but I want to present goals in first half and second half. Input looks like this (one cell):
2:3 (1:1)
And output should look like this:
2:3 (1:1,1:2)
I'm aware this could be done with a formula inside Excel but in my case, a vba solution would be better.
Thank you!
This will be my first post to bear with me. I've ran into an odd problem that I hope someone has a solution to.
I have a module that call several other moduels. The module works without errors. However, once i assign an Excel button to the macro and click it I get the following error:
runtime error 438 : Object doesn't support this property or method
and the following line inside one of the modules is highlighted:
FTH = CInt(Evaluate(FTH))
If i try to execute the macro again, but not by using the button, I get the same error. In other words, what worked fine before adding the button doesn't work any longer.
I'm just learning vba and I know that the macro isn't pretty so i'm not surprised that I get an error but I'm surprised it seems to work just fine before adding the button. If someone could explain why this is, or make my code a bit more elegant to bypass the issue, that would be much appreciated.
This is the macro that's giving me an error:
Code:
Sub fulltimefixer_fisk()
Dim Result As Range
Dim HTH As String
Dim HTA As String
Dim FTH As String
Dim FTA As String
For Each Result In Range("E2: E271")
HTH = Mid(Format(Result, "0"), 6, 1)
HTH = CInt(Evaluate(HTH))
HTA = Mid(Format(Result, "0"), 8, 1)
HTA = CInt(Evaluate(HTA))
FTH = Left(Result, 1)
FTH = CInt(Evaluate(FTH))
FTA = Mid(Result, 3, 1)
FTA = CInt(Evaluate(FTA))
Result.Value = Left(Result, 8) & "," & (FTH - HTH) & ":" & (FTA - HTA) & ")"
Next
End Sub
Short explanation: I'm gathering football fixtures but I want to present goals in first half and second half. Input looks like this (one cell):
2:3 (1:1)
And output should look like this:
2:3 (1:1,1:2)
I'm aware this could be done with a formula inside Excel but in my case, a vba solution would be better.
Thank you!