Hi All,
From this sites I learn lots of things and thanks Excel Forum by this site v r learning lots of new thing.
I have an issue in my below coding.
My question is -- I make below code to extract available TAB names from a workbook and its working nicely but printing all the TAB Names from a workbook its showing "Script out of range, Run time error - 9" and I am Zero in understanding the Run time error and please explain me what is this run time error - 9 why this number showing as a run time error.
Sub GetShtNam()
Dim ShtNam As String
Dim wsindex As Integer
mrow = 2
wsindex = 1
Range("A2:A" & ActiveSheet.UsedRange.Rows.Count).Select
Selection.ClearContents
Range("A1").Select
For i = 1 To 254
If Worksheets(wsindex).Name = "" Then
Range("A1").Select
Exit Sub
Else
ShtNam = Worksheets(wsindex).Name
Cells(mrow, 1).Value = ShtNam
mrow = mrow + 1
wsindex = wsindex + 1
End If
Next
End Sub
Can anyone please help me out and please explain with single quotation in script page so that i can understand easily.
Thanks in Advance !
Thanks,
Naveed.
Bookmarks