chrisaroundtown
Technical User
Hi,
I have a table with orders in it. I will enter in a report_month and try to count records which were ordered int the same month. This is easy enough however if I want to count all orders I will enter the report_month as "Total", it should then count everything. Below is my code, I am getting zero if the report_month is "Total".
' first I decide whether to report on a single month or everything
If report_month = "Total Then
order_month = "*" 'make order_month = anything
Else
order_month = report_month
End If
'further down I count the orders that equal order_month
If ActiveCell.Value = order_month then
order_count = order_count +1
Else
End If
Any ideas on how this can be achieve simply?
Thanks
Chris
I have a table with orders in it. I will enter in a report_month and try to count records which were ordered int the same month. This is easy enough however if I want to count all orders I will enter the report_month as "Total", it should then count everything. Below is my code, I am getting zero if the report_month is "Total".
' first I decide whether to report on a single month or everything
If report_month = "Total Then
order_month = "*" 'make order_month = anything
Else
order_month = report_month
End If
'further down I count the orders that equal order_month
If ActiveCell.Value = order_month then
order_count = order_count +1
Else
End If
Any ideas on how this can be achieve simply?
Thanks
Chris