I'm a programming newbie so please bear with me.
I currently have a sheet, Sheet1 "DataSheet", holding string (text) data over an undefined amount of rows in Columns A, B and C. Sheet2 "BlankSheet" is a template "Score Card" which I must duplicate indefinitely based on total rows of data entry in "DataSheet". I did this using a command button.
Sub Button2_Click()
Dim i As Long
Dim xNumber As Integer
Dim xName As String
Dim xActiveSheet As Worksheet
On Error Resume Next
Application.ScreenUpdating = False
Set xActiveSheet = ThisWorkbook.Worksheets("BlankSheet")
xNumber = Range("J2")
For i = 1 To xNumber
xName = ActiveSheet.Name
xActiveSheet.Copy after:=ActiveWorkbook.Sheets(xName)
ActiveSheet.Name = "Individual Score Sheet" & i
Next
xActiveSheet.Activate
Application.ScreenUpdating = True
CommandButton1.Enabled = False
End Sub
With the appropriate amount of Score Sheets created, I need to export personal data from "DataSheet" from Columns A, B and C to each Score Card.
ex:
"DataSheet" Cell A2 needs to go to "Individual Score Sheet1" Range A6:E6 (Merged Cell), "DataSheet" Cell B2 to "Individual Score Sheet1" Range F6:I6 (Merged Cell), and "DataSheet" Cell C2 to Individual Score Sheet1" Range J6:N6 (Merged Cell)
"DataSheet" Cell A3 needs to go to "Individual Score Sheet2" Range A6:E6 (Merged Cell), "DataSheet" Cell B3 to "Individual Score Sheet2" Range F6:I6 (Merged Cell), and "DataSheet" Cell C3 to Individual Score Sheet2" Range J6:N6 (Merged Cell)
etc, etc.. Until rows are blank.
So far I have:
Sub Button3_Click()
Dim ws As Worksheet
Application.ScreenUpdating = False
With Sheet1
For Each r In .Range("A1", .Range("A1").End(xlDown))
For Each ws In Sheets
Select Case ws.Name
Case "DataSheet", "BlankSheet"
Case Else
ws.Select
ws.Range("A6") = r
End Select
Next ws
Next r
End With
Application.ScreenUpdating = True
End Sub
The program accurately ignores "DataSheet" and "BlankSheet", iterates down the data in Column A and ends when there is no data, and iterates across the other Worksheets, however it only sets the value of each worksheet to the final iteration of data in Column A.
I haven't tried to make Column B or C work, yet. The goal is to automate generation of "x" amount of "Score Cards" to print.
How can I rework this to iterate the data into the "Individual Score Sheet#" Worksheets as it works down the rows in Columns A, B and C?
Is it possible to combine those two buttons into one command?
Thanks in advance!


