Using a macro to create a report on another worksheet

B

BZeyger

Hello,

I have been getting my feet wet in Excel VBA Programming. I have run into a
problem. I am tring to have people run a report through a macro. The main
document is on Worksheet1 and I want a user to push a button to have another
worksheet appear and input the selected rows.

Example of Worksheet1 (Master Document):

A B C D
1 Mike 567 Basketball PG
2 Barry 999 Hockey C
3 Jim 123 Basketball SF
4 John 123 Basketball SF
5 Ken 999 Hockey C
6 Mark 123 Basketball PF
7 Don 123 Baseball SF
8 Lou 999 Golf C
9 Sam 123 Basketball PF

I want Worksheet2 to display a report in a specific order. The first order
is all people with basketball and 123. Then second which is Hockey with 999.
The Third is Golf.

Example of output Worksheet2 (Report):

A B C D
1 Jim 123 Basketball SF
2 John 123 Basketball SF
3 Mark 123 Basketball PF
4 Sam 123 Basketball PF
5
6 Barry 999 Hockey C
7 Ken 999 Hockey C
8
8 Lou 999 Golf C


Thanks for the help
 
A

Allen Lance

That's a pretty broad issue you have there.

Since you're new to VBA you should play around a bit with the
recording feature to get a little closer to the final solution then
come back when you get stuck.

If your user is entering the data on sheet1 and you want to be able to
export a hard copy you might try simplying your issue a bit. Try
using a sort and filter. If you apply a sort on column "C" then do an
advanced filter on column "B" to only select items with "123" or "999"
then I think you'll have your basic format.

Hope this helps point you in the right direction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top