hattricktwenty
New Member
- Joined
- Aug 2, 2021
- Messages
- 3
- Office Version
- 2011
- Platform
- MacOS
This micro works but I want to insert the data into the Bottom of the table not the Top. Sub Complete_Post() sheet_name_to_create = Worksheets("New Customer").Range("C2") 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("All Customers Info") ActiveSheet.Name = sheet_name_to_create Worksheets("New Customer").Range("A1:aa999").Copy ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteAll ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteColumnWidths ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteFormats Range("Q5:W5").Copy Worksheets("All Customers Info").Select Range("a2").Select ActiveCell.EntireRow.Insert shift:=xlDown ActiveSheet.Paste link:=True End Sub | I tried this but it only gives a #REF in the first blank cell at the Bottom of thetable instead of links across the row. Sub Complete_Post() sheet_name_to_create = Worksheets("New Customer").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("All Customers Info") ActiveSheet.Name = sheet_name_to_create Worksheets("New Customer").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("Q5:W5").Copy Worksheets("All Customers Info").Select ActiveSheet.ListObjects("Table1").ListRows.Add NextFree = Range("A11:a" & Rows.Count).Cells.SpecialCells(xlCellTypeBlanks).Row Range("A" & NextFree).Select ActiveCell.EntireRow.Insert shift:=xlDown ActiveSheet.Paste link:=True End Sub |