Hi Guys,
Can someone enlighten me for this, why is my code error when i want to put a value on the new sheet that i just add.
The error is on the line below
Me.Sheets(Ticker).Range("A1").Value = "SASAS"
Runtime Error 13 , type mismatch is what show up.
Dim StartDate As Date, EndDate As Date
Dim WS As Worksheet
Dim Ticker
Dim LastRow As Integer, i As Integer
Dim qurl As String
StartDate = Me.Sheets(1).Range("B3").Value
EndDate = Me.Sheets(1).Range("D3").Value
LastRow = Me.Sheets(1).Range("F" & Rows.Count).End(xlUp).Row
i = 0
If LastRow = 3 Then
MsgBox ("Please put at least 1 ticker starting from cell F4")
Exit Sub
End If
For Each Ticker In Me.Sheets(1).Range("F4:F" & LastRow)
Me.Sheets.Add(After:=Sheets(Sheets.Count)).Name = Ticker
Me.Sheets(Ticker).Range("a1").Value = "SASAS"
Next Ticker
Exit Sub
Thanks in advance for the help.
Bookmarks