Consulting

Results 1 to 3 of 3

Thread: Solved: List worksheet names across columns

  1. #1
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location

    Solved: List worksheet names across columns

    Hi,



    May I have this code below be modified to list the worksheets names across columns? Say starting in cell D1 through Z1.


    [VBA]
    Sub ListWorkSheets()
    'Dumps a list of worksheet names in active cell and under
    Dim N As Integer
    For N = 1 To ActiveWorkbook.Worksheets.Count
    ActiveCell(N, 1) = Worksheets(N).Name
    Next
    End Sub
    [/VBA]
    SHAZAM!

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Something like this?
    [VBA]Sub ListWorkSheets()
    Dim N As Integer
    For N = 1 To ActiveWorkbook.Worksheets.Count
    Range("D1")(1, N) = Worksheets(N).Name
    Next
    End Sub[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    Cool! Thank You Lucas!
    SHAZAM!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •