How about
x = 6
Dim ws As Worksheet
Do Until ws.Name = "x"
Cells(x, 1).Value = ws.Name
x = x + 1
Loop
HTH,
JP
On Mar 5, 2:26*pm, Pam <P...@discussions.microsoft.com> wrote:
> I'm fairly new at this..
> I want to list all worksheets in my workbook until one named x.
> I'm using this code:
> Sub listworksheets()
> x = 6
> *Dim ws As Worksheet
> * * * For Each ws In ActiveWorkbook.Worksheets
> * * * Cells(x, 1).Value = ws.Name
> * * * * x = x + 1
> * * Next ws
>
> How do I change code to do what I want.
>
> Thank you
> End Sub
|