Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing scorecards and automatically change player names in Excel

Status
Not open for further replies.

hyz74

Technical User
Jun 1, 2005
6
SE
I've got an excel document consisting of two sheets.

In the first there are two scorecard layouts and on each scorecard one cell contains the name of the current player who's scorecard it will be. The reason for having two different scorecards on each print is that they are gonna be in A5 format.

In the second sheet I've got all the player names (a list of about 100 names).

Is it possible to get Excel to automatically fill in two different players name in these two cells in the first sheet, then print one copy, change to the next two players names, print one copy and so on until the last two scorecards have been printed.

Thanks,
Jess
 

Jess,

Please do not take anything for granted. It took me several minutes to determine what you meant by A5 format, since A5 in Excel is a cell reference. But then I recalled that there is an A5 PAPER SIZE.

I can't figger out a way to do this with native spreadsheet functionality. But here's a VBA solution
Code:
sub PrintScoreCards()
'this assumes that the list of names on sheet2 is in column A beginning in row 1
'also the two cells for the names are NAMED: Name1 & Name2
  iListCol = 1
  lListRow = 1
  for lRow = lListRow to sheet2.cells(lListRow, iListCol).end(xldown).row Step 2
    with sheet2.cells(lRow, iListCol)
      [Name1] = .value
      [Name2] = .offset(1).value
    end with
    Sheet1.printout
  next
end sub



Skip,

[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top