hattricktwenty
New Member
- Joined
- Aug 2, 2021
- Messages
- 3
- Office Version
- 2011
- Platform
- MacOS
The plan is to create a copy of sheet 2 to new sheet then take data from the new sheet to sheet 1, the data from the new sheet is automatically updated witch in turn can be seen on sheet 1. I am stuck on how to copy paste a link or create a live link to the next available cell on sheet 1
Here is the code I have so far
sheet_name_to_create = Worksheets("New Recipe").Range("b2")
For rep = 1 To (Worksheets.Count)
If Sheets(rep).Name = sheet_name_to_create Then
MsgBox "This sheet already exists!"
Exit Sub
End If
Next
Sheets.Add after:=Worksheets("New Sheet Name")
ActiveSheet.Name = sheet_name_to_create
Worksheets("Sheet 2").Range("A1:aa999").Copy
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteAll
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteFormulasAndNumberFormats
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteFormats
Range("P5:V5").Copy
Sheets("Sheet 1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Paste link:=True
Here is the code I have so far
sheet_name_to_create = Worksheets("New Recipe").Range("b2")
For rep = 1 To (Worksheets.Count)
If Sheets(rep).Name = sheet_name_to_create Then
MsgBox "This sheet already exists!"
Exit Sub
End If
Next
Sheets.Add after:=Worksheets("New Sheet Name")
ActiveSheet.Name = sheet_name_to_create
Worksheets("Sheet 2").Range("A1:aa999").Copy
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteAll
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteColumnWidths
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteFormulasAndNumberFormats
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteFormats
Range("P5:V5").Copy
Sheets("Sheet 1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Paste link:=True