Macro to create new row in separate worksheet when condition is met? in Excel Questions

Artist701

New Member
Joined
Nov 1, 2013
Messages
10
I ran into a problem i couldn't fix using formulas. I appreciate any help on this.

The problem: I have two excel sheets... (Representing a Horse Race with point system situation)

sheet 1 shows manual data. Includes:
Names, ID of the person, their horse name, date they raced and Points they received for that race.


sheet 2 will need to generate a new row of a person that participated as well as points they received that date and the total points.
(BUT only if they participated, or else row should Not generate at all)

Sheet 2 should display all the racers and their respective dates they raced that continue to populate if they race and points received those race days.. These should be stacked on top of each other, racer after racer displaying their results as shown in the example url below:

~ http://www.westcoastbarrelracing.com/Points_8-30.pdf

i hope this makes sense.

Thanx a mil.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Artist701,

You have posted a link to a PDF file. This means that if this was a problem where one needed to use your data, anyone trying to help you would have to enter the data manually. That makes no sense.

What version of Excel and Windows are you using?

Can you post a screenshot of the raw data worksheet, and, post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

To post your data, you can download and install one of the following two programs:
Excel Jeanie
MrExcel HTML Maker

Or, when using Internet Explorer, just put borders around your data in Excel and copy those cells into your post.
See reply #2 the BLUE text in the following link:
http://www.mrexcel.com/forum/about-board/444901-how-create-table-like-aladin.html#post2198045


If you are not able to give us screenshots:
You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.
 
Upvote 0
I apologize I'm new at this.

The excel file is attached.. and the PDF file is what it "should" output.
This can possibly be generated by a secondary sheet in my case "output" receiving a macro that can calculate and add the new row and add the total points?

I'm attaching a sample excel screenshot that i just created that is how we use to punch in the information. I've frozen the first 3 columns to keep those always showing. I hope I make better sense.

http://www.thebusinessjournal.com/images/test.png
 
Upvote 0
The second sheet "Output" is currently blank but should look like the PDF sample as shown in first message. I can customize the look and feel but the
calculations need a macro to generate rows. I may be wrong but I hear formulas do not populate new rows of data.
 
Upvote 0
Artist701,

You have posted another link to a graphic/png file.

In order to continue:

You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.


If you are not able to use BOX, then:

Click on the Reply to Thread button, and just put the word BUMP in the post. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Last edited:
Upvote 0
Artist701,

Thanks for the workbook.

Here is what we have so far:


Excel 2007
ABCDEFGH
112/1/139/5/139/6/13
2IDRIDER (Last, First Name)HORSERafter Bar MSJVRRR Product
32026RAllisonJolieKaties Merada8010
41068RAndersonEveGSP Golden Money Bar
51056RBailyBreannaSmokem Dry80
6
Data



Excel 2007
ABCD
1
2
3
4Alysson
5#N/A
6
7
8
Output



• sheet 1 shows manual data. Includes:
Names, ID of the person, their horse name, date they raced and Points they received for that race.

• sheet 2 will need to generate a new row of a person that participated as well as points they received that date and the total points. (BUT only if they participated, or else row should Not generate at all)

1. Please complete Sheet2 by manually copying the data from Sheet1 (no formulae).

2. Then post the workbook again.
 
Upvote 0
Artist701,

Thanks for the latest workbook, and, a very interesting/complex project. Let me think about this.

Here are some screenshots of the two worksheets, just in case anyone else wants to jump in.


Excel 2007
ABCDEFGH
112/1/139/5/139/6/13
2IDRIDER (Last, First Name)HORSERafter Bar MSJVRRR Product
32026RAllisonJolieKaties Merada8010
41068RAndersonEveGSP Golden Money Bar
51056RBailyBreannaSmokem Dry80
61000SJonesTomGem884444
73199SScottJeffFast Her66
83198SScottJeffFast Him80
9
Data




Excel 2007
ABCDEF
1Shows Attended and Points
2
3Alysson, Jolie
42026R
5Katies Merada
6
712/1/2013Rafter Bar M80
89/6/2013RR Product10
9
10# of shows attended - 2Total Points90
11
12
13Anderson, Eve
141068R
15GSP Golden Money Bar
16
17# of shows attended - 0Total Points0
18
19
20Baily, Breanna
211056R
22Smokem Dry
23
249/5/2013SJVR80
25
26# of shows attended - 1Total Points80
27
28
29Jones, Tom
301000S
31Gem
32
3312/1/2013Rafter Bar M88
349/5/2013SJVR44
359/6/2013RR Product44
36
37# of shows attended - 3Total Points220
38
39
40Scott, Jeff
413199S
42Fast Her
43
4412/1/2013Rafter Bar M80
459/6/2013RR Product10
46
47# of shows attended - 2Total Points90
48
49Fast Him
509/6/2013RR Product80
51
52# of shows attended - 1Total Points80
53
54
Output
 
Last edited:
Upvote 0
Thanx for looking into it. I can manage to get all the calculations I need via formulas but the problem lies in generating new rows for new event dates added and than getting a new calculation based on the new information.




Artist701,

Thanks for the latest workbook, and, a very interesting/complex project. Let me think about this.

Here are some screenshots of the two worksheets, just in case anyone else wants to jump in.

Excel 2007
ABCDEFGH
2026RAllisonJolieKaties Merada
1068RAndersonEveGSP Golden Money Bar
1056RBailyBreannaSmokem Dry
1000SJonesTomGem
3199SScottJeffFast Her
3198SScottJeffFast Him

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #D8D8D8"][/TD]
[TD="bgcolor: #D8D8D8"][/TD]
[TD="bgcolor: #D8D8D8"][/TD]
[TD="bgcolor: #D8D8D8"][/TD]
[TD="bgcolor: #D8D8D8, align: center"]12/1/13[/TD]
[TD="bgcolor: #D8D8D8, align: center"]9/5/13[/TD]
[TD="bgcolor: #D8D8D8, align: center"]9/6/13[/TD]
[TD="bgcolor: #D8D8D8, align: center"][/TD]

[TD="align: center"]2[/TD]
[TD="bgcolor: #EEECE1"]ID[/TD]
[TD="bgcolor: #EEECE1, align: center"]RIDER (Last, First Name)[/TD]
[TD="bgcolor: #EEECE1, align: center"][/TD]
[TD="bgcolor: #EEECE1"]HORSE[/TD]
[TD="bgcolor: #EEECE1, align: center"]Rafter Bar M[/TD]
[TD="bgcolor: #EEECE1, align: center"]SJVR[/TD]
[TD="bgcolor: #EEECE1, align: center"]RR Product[/TD]
[TD="bgcolor: #EEECE1, align: center"][/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]80[/TD]
[TD="align: center"][/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]

[TD="align: center"]4[/TD]

[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]5[/TD]

[TD="align: center"][/TD]
[TD="align: center"]80[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]6[/TD]

[TD="align: center"]88[/TD]
[TD="align: center"]44[/TD]
[TD="align: center"]44[/TD]
[TD="align: center"][/TD]

[TD="align: center"]7[/TD]

[TD="align: center"]66[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]8[/TD]

[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]80[/TD]
[TD="align: center"][/TD]

[TD="align: center"]9[/TD]

[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

</tbody>
Data




Excel 2007
ABCDEF
Shows Attended and Points
2026R
Katies Merada
12/1/2013Rafter Bar M
1068R
GSP Golden Money Bar
1056R
Smokem Dry
1000S
Gem
9/5/2013SJVR
3199S
Fast Her
9/6/2013RR Product
# of shows attended - 2
Fast Him

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: center"][/TD]

[TD="align: center"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="bgcolor: #DDD9C3, align: center"][/TD]
[TD="bgcolor: #DDD9C3"]Alysson, Jolie[/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"]80[/TD]

[TD="align: center"]8[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]9/6/2013[/TD]
[TD="bgcolor: #F2F2F2"]RR Product[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"]10[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]# of shows attended - 2[/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2, align: center"]Total Points[/TD]
[TD="bgcolor: #F2F2F2, align: right"]90[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]12[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13[/TD]
[TD="bgcolor: #DDD9C3, align: center"][/TD]
[TD="bgcolor: #DDD9C3"]Anderson, Eve[/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]

[TD="align: center"]14[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]16[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]17[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]# of shows attended - 0[/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2, align: center"]Total Points[/TD]
[TD="bgcolor: #F2F2F2, align: right"]0[/TD]

[TD="align: center"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]19[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]20[/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3"]Baily, Breanna[/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]

[TD="align: center"]21[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]22[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]23[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]24[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]9/5/2013[/TD]
[TD="bgcolor: #F2F2F2"]SJVR[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"]80[/TD]

[TD="align: center"]25[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]26[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]# of shows attended - 1[/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2, align: center"]Total Points[/TD]
[TD="bgcolor: #F2F2F2, align: right"]80[/TD]

[TD="align: center"]27[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]28[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]29[/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3"]Jones, Tom[/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]

[TD="align: center"]30[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]31[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]32[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]33[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]12/1/2013[/TD]
[TD="bgcolor: #F2F2F2"]Rafter Bar M[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"]88[/TD]

[TD="align: center"]34[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"]44[/TD]

[TD="align: center"]35[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]9/6/2013[/TD]
[TD="bgcolor: #F2F2F2"]RR Product[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"]44[/TD]

[TD="align: center"]36[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]37[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]# of shows attended - 3[/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2, align: center"]Total Points[/TD]
[TD="bgcolor: #F2F2F2, align: right"]220[/TD]

[TD="align: center"]38[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]39[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]40[/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3"]Scott, Jeff[/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]
[TD="bgcolor: #DDD9C3, align: right"][/TD]

[TD="align: center"]41[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]42[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]43[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]44[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]12/1/2013[/TD]
[TD="bgcolor: #F2F2F2"]Rafter Bar M[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"]80[/TD]

[TD="align: center"]45[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"]10[/TD]

[TD="align: center"]46[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]

[TD="align: center"]47[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]Total Points[/TD]
[TD="align: right"]90[/TD]

[TD="align: center"]48[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]

[TD="align: center"]49[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]50[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"]9/6/2013[/TD]
[TD="bgcolor: #F2F2F2"]RR Product[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2, align: right"]80[/TD]

[TD="align: center"]51[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]52[/TD]
[TD="bgcolor: #F2F2F2, align: right"][/TD]
[TD="bgcolor: #F2F2F2"] [/TD]
[TD="bgcolor: #F2F2F2"]# of shows attended - 1[/TD]
[TD="bgcolor: #F2F2F2"][/TD]
[TD="bgcolor: #F2F2F2"]Total Points[/TD]
[TD="bgcolor: #F2F2F2, align: right"]80[/TD]

[TD="align: center"]53[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]54[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Output
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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