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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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
Back
Top