Hi All
I hope the subject is not to misleading as I'm new to Excel/VBA and not sure how to describe it in a short sentence. Please let me know if I need to add additional info or change the format.
The background:
Using office 2010, Win 7
Workbook contains 2 sheets called 'Blue' which is a score sheet for printing and 'Entrants' which is the db containing all the details of participants.
I have a print macro (can't recall where I got it) that populates the score sheet with a participants info and loops through the database.
Behind the 'Entrants' sheet I have the following
The module
What I would like to do:
I want to print three different score sheets. The only thing to change is cell C8 with a different name and date (but same list of entrants).
- How can I do this by letting the macro prompt me for the correct value and printing the set and correct value in C8?
- Or is there another way?
Unfortunately the only way I can do it at the moment is to create another workbook, edit the cell C8 value and update the rest of the code with the correct sheet names if needed.
Thanks for your time and patience
I hope the subject is not to misleading as I'm new to Excel/VBA and not sure how to describe it in a short sentence. Please let me know if I need to add additional info or change the format.
The background:
Using office 2010, Win 7
Workbook contains 2 sheets called 'Blue' which is a score sheet for printing and 'Entrants' which is the db containing all the details of participants.
I have a print macro (can't recall where I got it) that populates the score sheet with a participants info and loops through the database.
Behind the 'Entrants' sheet I have the following
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Range numbers to be confirmed!!!
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Worksheets("Blue").Range("C8").Formula = "Blue Range - 26 March 2011" 'Range/Date to change as required
Worksheets("Blue").Range("E13").Formula = Target.Offset(0, 1) & " " & Target.Offset(0, 2) 'Name & Surname
Worksheets("Blue").Range("E15").Formula = Target.Offset(0, 6)
Worksheets("Blue").Range("E17").Formula = Target.Offset(0, 3)
Worksheets("Blue").Range("E19").Formula = Target.Offset(0, 4)
Worksheets("Blue").Range("E21").Formula = Target.Offset(0, 5)
Worksheets("Blue").Range("C2").Formula = Target.Offset(0, 11)
Worksheets("Blue").Range("C5").Formula = Target.Offset(0, 10)
End Sub
The module
Code:
Sub PrintAllCards()
Sheets("Entrants").Select
Range("A2").Select
Do Until Selection = ""
Sheets("Blue").PrintOut
Selection.Offset(1, 0).Select
Loop
End Sub
What I would like to do:
I want to print three different score sheets. The only thing to change is cell C8 with a different name and date (but same list of entrants).
- How can I do this by letting the macro prompt me for the correct value and printing the set and correct value in C8?
- Or is there another way?
Unfortunately the only way I can do it at the moment is to create another workbook, edit the cell C8 value and update the rest of the code with the correct sheet names if needed.
Thanks for your time and patience