Hello,
I'm trying to make a macro that simply creates new tabs and assigns names to each by referencing a list. After doing so, I need it to delete Columns A:F per each new tab.
The macro works fine if I take out
but obviously I need that in there. Any ideas what to do? Thanks in advance. Here's the code:
I'm trying to make a macro that simply creates new tabs and assigns names to each by referencing a list. After doing so, I need it to delete Columns A:F per each new tab.
The macro works fine if I take out
Code:
Columns("A:F").Delete
Code:
Sub Macro2()
'
' Macro2 Macro
Dim i As Integer
Dim last_SUP As Integer
Dim SUP_nme As String
i = 2
Set sht = ThisWorkbook.Worksheets(Sheet2.Name)
last_SUP = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
Do While i <= last_SUP
SUP_nme = Cells(i, 1).Value
Columns("A:F").Delete
Sheets("SUP List").Copy After:=Sheets(1)
Sheets("SUP List (2)").Name = SUP_nme
i = i + 1
Loop
End Sub