Need help to write a macro

kramesh

New Member
Joined
Oct 11, 2006
Messages
3
Hi all,
I have the following data in sheet1.

id state date
123 A 11/2/05
234 B 11/2/05
123 B 11/4/05
234 C 11/4/05

I need to read the above data and count how many are in State-A , State-B, State-C for a particular date and write the following in sheet2.

Sate-A Sate-B State-C
------------------------------------------------------
11/2/05 <total count> <total-count>
--------------------------------------------------------
11/3/05
-------------------------------------------------------
11/4/05
-----------------------------------------------------
I am new to VB and don't know how to do this. Your help is appreciated.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Are you sure you need code for this?

It looks to me like something that could be done with either a pivot table or formulas.
 

kramesh

New Member
Joined
Oct 11, 2006
Messages
3
How can I do with the formula? The problem is once the state changes(e: from State-A to State-B on date 11/4/05), the count value for that date in column(State-B) will be incremenated by 1 and count value of Column(State-A) will be decremented by 1
 

Forum statistics

Threads
1,141,098
Messages
5,704,319
Members
421,338
Latest member
Pepess

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top