If I have a list in column B & C, Is there a way to copy a premade sheet based on what is in column B, and rename it what is in column C? I have current modules made with a button for each that have
I wrote the following:
Running with the application box, the proper template sheets copy and rename as what I type in. I'm hoping to remove the application box and add something like...
Any help getting this to work would be awesome!
VBA Code:
Sub HVCircuitBreaker()
Dim WsName As String: WsName = Application.InputBox("Enter New SheetName")
Dim CPY As Integer: IDX = Sheets("HVCIRCUITBREAKER_TEMP").Index
Sheets("HVCIRCUITBREAKER_TEMP").Visible = True
Sheets("HVCIRCUITBREAKER_TEMP").Copy After:=Sheets(IDX)
Sheets("HVCIRCUITBREAKER_TEMP").Visible = False
ActiveSheet.Name = WsName
End Sub
I wrote the following:
Code:
Sub NexMCC1_Click()
Dim rng As Range
Dim Nex As Range
Dim i As Long
If Range("C3").Value = True Then
For Each rng In Range("Nex")
For i = 4 To 20
If Range("B" & i) = "" Then GoTo SheDone
If Range("B" & i) = "BKR" Then
Run "HVCircuitBreaker"
ElseIf Range("B" & i) = "TRN" Then
Run "XFMR"
ElseIf Range("B" & i) = "PT" Then
Run "PotentialTrans"
End If
Sheets("SiteList").Activate
Next
Next
Else: GoTo DoNothing
End If
SheDone: MsgBox ("Export Complete")
DoNothing:
End Sub
Running with the application box, the proper template sheets copy and rename as what I type in. I'm hoping to remove the application box and add something like...
Code:
If Range("C3").Value = True Then
For Each rng In Range("Nex")
For i = 4 To 20
If Range("B" & i) = "" Then GoTo SheDone
If Range("B" & i) = "BKR" Then
Run "HVCircuitBreaker"
Activesheet.Name = Range("C" & i)
Any help getting this to work would be awesome!