Hi
I'm trying to retrieve the worksheet names to a specif cell and populate from that point only with the names of the visible sheets, but It keeps returning only the last visible sheet name and not the sheets that are visible. Could someone plase point me to where the code is failling - I'm self learner and start with VBA macros a couple of months so I'm still learning how to identify when the error show up
I'm trying to retrieve the worksheet names to a specif cell and populate from that point only with the names of the visible sheets, but It keeps returning only the last visible sheet name and not the sheets that are visible. Could someone plase point me to where the code is failling - I'm self learner and start with VBA macros a couple of months so I'm still learning how to identify when the error show up
Code:
Sub Summary()
Dim wks As Worksheet
ultl = Sheets("Control").Cells(1048576, 4).End(xlUp).Row
For i = 31 To ultl
For Each wks In Worksheets(Array("Emergencias Bancomer", "Emergencias Banamex", "Emergencias Cheques", _
"Rentas Transfer", "Rentas Cheques", "Indemnizaciones", "Indemnizaciones Cheque", "Banamex Automaticos", _
"Cheques", "Bancomer", "Cajas", "Anticipos Empleados", "USD", "EUR", "Secretarias", "Luz", "Agua"))
If wks.Visible Then
Sheets("Control").Cells(i, 5) = wks.Name
End If
Next wks
Next i
End Sub