rockchalk33
Board Regular
- Joined
- Jan 12, 2016
- Messages
- 111
Code:
Sub text2()
Dim userDate As String
Sheets("Sheet11").Select
Range("Z1").Select
userDate = InputBox("Please type a date to search in MM/DD/YYYY format")
If userDate = vbNullString Then Exit Sub
Sheet11.Range("Z1").Value = Application.WorksheetFunction.SumIfs(Range("O:O"), Range("B:B"), userDate, Range("A:A"), "Shop")
End Sub
When this is manually entered using the Excel window, I am obtaining the correct answer...below is the Excel forumula...in this particular example I am using 1/2/2016 as the example for the userDate:
=SUMIFS(O:O,B:B,"1/2/2016",A:A,"Shop")
When the VBA code is ran, there is no value displayed in cell Z1.....can someone please help me with this!