So I am currently trying to adjust a workbook so on a single button press, it will copy the current worksheet and add it as the next worksheet and rename it "Client Location N" with only the format pasted in. It will also copy and paste another worksheet to the end, that has basically the same information copied over from the first sheet, and will name it 'Simplicity N". I need to make it so the copied sheets match up each time, instead of all populating from the first sheet. I also have code on the first worksheet and it will need to change to reflect the correct page every time. Is it even possible?
Thanks.
Thanks.
Code:
Private Sub CommandButton1_Click()
Dim mySheets
Dim i As Long
mySheets = Array("Client Location 1")
For i = LBound(mySheets) To UBound(mySheets)
With Sheets(mySheets(i))
nextCol = .Cells(50, .Columns.Count).End(xlToLeft).Column + 2
.Range("I50:K55").Copy
.Cells(50, nextCol).PasteSpecial xlPasteFormats
End With
Next i
End Sub
Private Sub CommandButton2_Click()
Dim mySheets
Dim theSheets
Dim i As Long
Dim x As Long
mySheets = Array("Client Location 1")
For i = LBound(mySheets) To UBound(mySheets)
With Sheets(mySheets(i))
nextRow = .Cells(.Rows.Count, 3).End(xlUp).Row + 1
.Range("C84:T84").Copy
.Cells(nextRow, 3).PasteSpecial xlPasteFormats
.Cells(nextRow, 3).PasteSpecial xlPasteValidation
End With
Next i
theSheets = Array("Simplicity 1")
For x = LBound(theSheets) To UBound(mySheets)
With Sheets(theSheets(x))
nextRow = .Cells(85, 3).End(xlDown).Row + 1
.Cells(108, 1).EntireRow.Insert Shift:=xlDown
.Range("C90:AW90").Copy
.Cells(nextRow, 3).PasteSpecial xlPasteFormats
.Cells(nextRow, 3).PasteSpecial xlFormulas
End With
Next x
End Sub
Private Sub CommandButton3_Click()
Dim mySheets
Dim i As Long
mySheets = Array("Client Location 1")
For i = LBound(mySheets) To UBound(mySheets)
With Sheets(mySheets(i))
nextCol = .Cells(65, .Columns.Count).End(xlToLeft).Column + 2
.Range("I65:K68").Copy
.Cells(65, nextCol).PasteSpecial xlPasteFormats
End With
Next i
End Sub
Private Sub CommandButton4_Click()
Dim mySheets
Dim i As Long
mySheets = Array("Client Location 1")
For i = LBound(mySheets) To UBound(mySheets)
With Sheets(mySheets(i))
nextCol = .Cells(50, .Columns.Count).End(xlToLeft).Column + 2
.Range("I50:K55").Copy
.Cells(50, nextCol).PasteSpecial xlPasteFormats
End With
Next i
End Sub
Private Sub CommandButton5_Click()
Dim mySheets
Dim i As Long
mySheets = Array("Client Location 1")
For i = LBound(mySheets) To UBound(mySheets)
With Sheets(mySheets(i))
nextCol = .Cells(65, .Columns.Count).End(xlToLeft).Column + 2
.Range("I65:K68").Copy
.Cells(65, nextCol).PasteSpecial xlPasteFormats
End With
Next i
End Sub
Private Sub CommandButton6_Click()
//will become the button command to copy both worksheets and adjust code.
End Sub