well
Range("B:B")
is column B on the active sheet, but if the active sheet doesn't happen to be the right sheet when the code runs you might get the wrong results, so you might qualify the range with:
Sheets("Sheet1").Range("B:B")
which will always be column B on on Sheet1, regardless if another sheet happens to be the active sheet. This can be taken further to protect against the wrong sheet1 being referred to; you might have more than one workbook open with a Sheet1 in it, and if the wrong workbook is active...
So you can use the likes of
Thisworkbook.Sheets("Sheet1").Range("B:B")
or
Workbooks("myfile.xls").Sheets("Sheet1").Range("B:B")
etc. etc.

When testing/developing code there's no need as you'll make sure the right sheet is active when you step through the code.

Regarding it returning 0, first try not contsraining the variable to double - it should work but, test it without doing this and see if it still gives 0. Second, I seem to remember that SumIf in versions up to XL2003 won't work with a full column, try the likes of Range("B1:B1000") in the formula instead (I think I might be wrong here (edited after posting)). Finally, try the formula on the worksheet itself and see if it works there, then translate the formula to vba.