Re: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing

2010-07-03 Thread goofy_heron
= 1 to i since i is undefined. Regards - Dave Date: Fri, 2 Jul 2010 11:52:06 -0700 Subject: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing From: bpascal...@gmail.com To: excel-macros@googlegroups.com Hi, Could you please tell me why this code is not working? From

RE: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing

2010-07-03 Thread Dave Bonallack
, Dave Bonallack davebonall...@hotmail.com wrote: Hi, I don't think you can say For i = 1 to i since i is undefined. Regards - Dave Date: Fri, 2 Jul 2010 11:52:06 -0700 Subject: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing From: bpascal...@gmail.com

Re: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing

2010-07-03 Thread Swapnil Palande
Hi, Following is the correct code: Public Sub SheetList() Range(A1).Select For i = 1 To ActiveWorkbook.Sheets.Count Cells(i, 1) = ActiveWorkbook.Sheets(i).Name Next End Sub There is syntax error in your code in for loop And ActiveWorkbook.Sheets.Count this line will return

Re: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing

2010-07-03 Thread who
Even a little shorter. Public Sub SheetList() For i = 1 To Sheets.Count Cells(i, 1).Value = Sheets(i).Name Next i End Sub On Jul 3, 3:53 am, Swapnil Palande swapnilp1...@gmail.com wrote: Hi, Following is the correct code: Public Sub SheetList()    Range(A1).Select    For i = 1

$$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing

2010-07-02 Thread goofy_heron
Hi, Could you please tell me why this code is not working? From a programming background, i see no reasons why the code is not giving worksheets names through this for loop : Option Explicit Public Sub SheetList() Dim W As Worksheet Dim i As Integer Range(A1).Select For i = 1

RE: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing

2010-07-02 Thread Dave Bonallack
Hi, I don't think you can say For i = 1 to i since i is undefined. Regards - Dave Date: Fri, 2 Jul 2010 11:52:06 -0700 Subject: $$Excel-Macros$$ First sips of Vba for Excel : Worksheet listing From: bpascal...@gmail.com To: excel-macros@googlegroups.com Hi, Could you please tell me why