molotowski
New Member
- Joined
- Jun 16, 2015
- Messages
- 2
The below is a simple SumIf calculation where I want to sum if >= the variable k that is declared as a Double.
This, however returns 0. If I change k for any integer, 3, 4 etc, it returns the "true" value. But if I change k for 4.23983 it returns 0.
I already tried to declare another Double variable (lets say a) and put a = sumif(...). But that gives me 0 as well. I also tried "">="& k &""" but that doesn't work either (found that on Google).
I'm very new to VBA and Excel so I might have missed some basic things out. All help is very appreciated!
This, however returns 0. If I change k for any integer, 3, 4 etc, it returns the "true" value. But if I change k for 4.23983 it returns 0.
I already tried to declare another Double variable (lets say a) and put a = sumif(...). But that gives me 0 as well. I also tried "">="& k &""" but that doesn't work either (found that on Google).
I'm very new to VBA and Excel so I might have missed some basic things out. All help is very appreciated!
Code:
Worksheets("ES").Cells(j + 10, 6).Value = Application.WorksheetFunction.SumIf(Worksheets("help").Range("A1:A4273"), ">=" & k, Worksheets("help").Range("A1:A4273"))