kevvukeka
05-19-2013, 10:50 PM
Hi All,
I need some help with the below code. I want to use this one to make an index sheet. The below code basically extracts all the sheet names in the workbook to a new sheet. There are few sheets that are hidden and i dont want those sheet names in index. so wrote the macro as below. But i still see blank rows.
sub index()
Sheets("Sheet").Select
Sheets.Add
For I = 1 To Sheets.Count
If (Sheets(I).Visible) = True Then
With ActiveSheet.Cells(I, 1)
.Value
= CStr(Sheets(I).Name)
End With
End If
Next I
ActiveSheet.UsedRange.Select
For Each cel In Selection
If cel.Value =
"" Then
cel.EntireRow.select
Selection.Delete Shift:=xlUp
End If
Next cel
selection.end(xlup).select
end sub
Thanks & Regards,
Praveen
I need some help with the below code. I want to use this one to make an index sheet. The below code basically extracts all the sheet names in the workbook to a new sheet. There are few sheets that are hidden and i dont want those sheet names in index. so wrote the macro as below. But i still see blank rows.
sub index()
Sheets("Sheet").Select
Sheets.Add
For I = 1 To Sheets.Count
If (Sheets(I).Visible) = True Then
With ActiveSheet.Cells(I, 1)
.Value
= CStr(Sheets(I).Name)
End With
End If
Next I
ActiveSheet.UsedRange.Select
For Each cel In Selection
If cel.Value =
"" Then
cel.EntireRow.select
Selection.Delete Shift:=xlUp
End If
Next cel
selection.end(xlup).select
end sub
Thanks & Regards,
Praveen