OK,
Been reading around and I have managed to refine the code as follows:
[Private Sub UserForm_Initialize()
Set Rng1 = Sheets("Sheet1").Range(("A2"), Range("A2")).End(xlDown)
Set Rng2 = Sheets("Sheet1").Range(("C2"), Range("C2")).End(xlDown)
For i = 1 To 52
Me.ComboBox1.AddItem (i)
Next i
Me.ComboBox1.AddItem "*.*"
Me.ComboBox1 = "*.*"
Smif = Application.SumIf(Rng1, ComboBox1.Value, Rng2)
Me.ComboBox2 = Smif
End Sub]
The code runs, the problem I have now is that the sum if returns zero.For every value of combbox 1 selected.
If I recplace with hard coded ranges and a number to search then it works. I think it is something to do with passing arguments to the function and setting them as numbers, but not sure.
Can anyone advise to why this is happending and or a solution?
Cheers
GM
Bookmarks