vba output to rows not colums

justme1122

New Member
Joined
Mar 6, 2011
Messages
47
Hi guys

I have this code that lists the titles of all worksheets. Any idea's on how to make it out put to a row unstead of a colum.

PHP:
Sub C_BuildIndex_Click()
Dim i As Long
Sheets("data").Select
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For i = 3 To Worksheets.Count
    Application.StatusBar = Format(100 * i / Worksheets.Count, "0.0") & "% done..."
        Range("A" & i + 0) = Sheets(i).Name
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.StatusBar = False
  End Sub


Thanks for your time
Scott
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try this: output in row 1

Code:
Sub C_BuildIndex_Click()
Dim i As Long
Sheets("data").Select
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For i = 3 To Worksheets.Count
    Application.StatusBar = Format(100 * i / Worksheets.Count, "0.0") & "% done..."
        Cells(1, i - 2).Value = Sheets(i).Name
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.StatusBar = False
  End Sub
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top