Hello everyone!
I've been reading the forum and I was unable to find what I needed so I'm trying to see if I can get a little help. I may have missed the post that may correlate to this question, if so I apologize.
I created a template that the person enters info on the "main" page and it goes to each individual page. (i.e info for john entered on the main page would go to the sheet labeled john). I've added a new macro that allows the user to add names and sorts them to be in alphabetical order and the information updates and follows on the individual pages. There are 2 sections on the individual pages that have to be entered manually on each page and therefore do not move with the rest of the info. I have another macro that takes all of that info on each page and copies all of it to another individual page. See code below. The problem is that I want it to sort it out by name and copy back to the approriate page. Unfortunately, I am unable to post the template or send it out due to that I utilize at my job along with other team leaders and is considered "confidential". I know my description is kinda vague, but can anyone point me in the right direction. Here is what i got so far:
Sub Datasave()
Application.ScreenUpdating = False
Dim s As Integer
s = 2
Do While s <> 19
Worksheets(s).Activate
Worksheets(s).Visible = True
Sheets("Stats").Select
s = s + 1
Loop
'creating temporary data page
Sheets("Stats").Select
Sheets.Add
ActiveSheet.Name = "Data"
Sheets("Data").Select
Sheets("Data").Move After:=Sheets(19)
'copying data
Dim j As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim x As String
Dim z As String
d = 1
j = 2
b = 2
c = 11
Do While j <> 19
Worksheets(j).Select
x = Range("A1")
Sheets("Data").Select
Range("A" & d).Select
ActiveCell.FormulaR1C1 = x
Worksheets(j).Select
Range("A27:B36").Select
Selection.Copy
Sheets("Data").Select
Range("A" & b).Select
ActiveSheet.Paste
Worksheets(j).Select
Range("A39").Select
Selection.Copy
Sheets("Data").Select
Range("A" & c).Select
ActiveSheet.Paste
j = j + 1
b = b + 19
c = c + 19
d = d + 19
Loop
'delete data
Do While j <> 19
j = 3
Worksheets(j).Activate
Range("A27:B36").Delete
Range("A39:I48").Delete
j = j + 1
Range("A1").Select
Loop
End Sub
Thanks for any help,
Brandon
I've been reading the forum and I was unable to find what I needed so I'm trying to see if I can get a little help. I may have missed the post that may correlate to this question, if so I apologize.
I created a template that the person enters info on the "main" page and it goes to each individual page. (i.e info for john entered on the main page would go to the sheet labeled john). I've added a new macro that allows the user to add names and sorts them to be in alphabetical order and the information updates and follows on the individual pages. There are 2 sections on the individual pages that have to be entered manually on each page and therefore do not move with the rest of the info. I have another macro that takes all of that info on each page and copies all of it to another individual page. See code below. The problem is that I want it to sort it out by name and copy back to the approriate page. Unfortunately, I am unable to post the template or send it out due to that I utilize at my job along with other team leaders and is considered "confidential". I know my description is kinda vague, but can anyone point me in the right direction. Here is what i got so far:
Sub Datasave()
Application.ScreenUpdating = False
Dim s As Integer
s = 2
Do While s <> 19
Worksheets(s).Activate
Worksheets(s).Visible = True
Sheets("Stats").Select
s = s + 1
Loop
'creating temporary data page
Sheets("Stats").Select
Sheets.Add
ActiveSheet.Name = "Data"
Sheets("Data").Select
Sheets("Data").Move After:=Sheets(19)
'copying data
Dim j As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim x As String
Dim z As String
d = 1
j = 2
b = 2
c = 11
Do While j <> 19
Worksheets(j).Select
x = Range("A1")
Sheets("Data").Select
Range("A" & d).Select
ActiveCell.FormulaR1C1 = x
Worksheets(j).Select
Range("A27:B36").Select
Selection.Copy
Sheets("Data").Select
Range("A" & b).Select
ActiveSheet.Paste
Worksheets(j).Select
Range("A39").Select
Selection.Copy
Sheets("Data").Select
Range("A" & c).Select
ActiveSheet.Paste
j = j + 1
b = b + 19
c = c + 19
d = d + 19
Loop
'delete data
Do While j <> 19
j = 3
Worksheets(j).Activate
Range("A27:B36").Delete
Range("A39:I48").Delete
j = j + 1
Range("A1").Select
Loop
End Sub
Thanks for any help,
Brandon