somnath6309
New Member
Dear Sir/Madam,
Following is the vba code that extracts sheet_names and makes the list in a separate sheet. I am pursuing vba course and know about "with_end_with" & For_next Loop Techniques. But I have not understood the Red underline portions that requires a little bit help of you to be understood. CStr is a vba function but what is its use? Please give me some explanation about the Red Lines as follows:
Set NewSheet = Sheets.Add(Type:=xlWorksheet)
For i = 1 To Sheets.Count
With NewSheet.Cells(i, 1)
.NumberFormat = "@"
.Value = CStr(Sheets(i).Name)
End With
Next i
Regards,
Somnath
Following is the vba code that extracts sheet_names and makes the list in a separate sheet. I am pursuing vba course and know about "with_end_with" & For_next Loop Techniques. But I have not understood the Red underline portions that requires a little bit help of you to be understood. CStr is a vba function but what is its use? Please give me some explanation about the Red Lines as follows:
Set NewSheet = Sheets.Add(Type:=xlWorksheet)
For i = 1 To Sheets.Count
With NewSheet.Cells(i, 1)
.NumberFormat = "@"
.Value = CStr(Sheets(i).Name)
End With
Next i
Regards,
Somnath