As part of bigger Macro at some point I have to create a certain numbers of sheets in certain position.
To do that and, as I am a begginer with macros (and programming in general) I have done a test with a simple scenario.
I have seen a similar question here
But, adapting that code to my case I'm only able to create the first sheet and getting an error in the following.
The code right now is this:
Sub AddSheets()
Dim siteCount As Integer
Dim i As Integer
siteCount = 2
For i = 1 To siteCount
Name = Cells(i, 26)
Set site_i = Sheets.Add(after:=Sheets("DLC_" & CStr(Name)))
site_i.Name = "DLC" & CStr(Name)
Next i
End Sub
What I'm not seeing?