ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SELECTED SHEETS' NAMES (https://www.excelbanter.com/excel-programming/431715-selected-sheets-names.html)

Faraz A. Qureshi

SELECTED SHEETS' NAMES
 
What looping code would display dialog boxes, one after the other, displaying
the names of the Sheets which are selected/grouped?
--
Best Regards,

Faraz

Faraz A. Qureshi

SELECTED SHEETS' NAMES
 
I have found a code like:

Sub test()
Dim sh As Worksheet
For Each sh In ActiveWindow.SelectedSheets
MsgBox sh.Name
Next sh
End Sub

However, how to have the same names be placed at the very first available
cells in the first sheet?
--
Best Regards,

Faraz


"Faraz A. Qureshi" wrote:

What looping code would display dialog boxes, one after the other, displaying
the names of the Sheets which are selected/grouped?
--
Best Regards,

Faraz


Bob Phillips[_3_]

SELECTED SHEETS' NAMES
 
Dim sh As Worksheet
Dim NextRow As Long
NextRow = 1
Worksheets(1).Columns(1).ClearContents
For Each sh In ActiveWindow.SelectedSheets
Worksheets(1).Cells(NextRow, "A").Value = sh.Name
NextRow = NextRow + 1
Next sh


--
__________________________________
HTH

Bob

"Faraz A. Qureshi" wrote in
message ...
I have found a code like:

Sub test()
Dim sh As Worksheet
For Each sh In ActiveWindow.SelectedSheets
MsgBox sh.Name
Next sh
End Sub

However, how to have the same names be placed at the very first available
cells in the first sheet?
--
Best Regards,

Faraz


"Faraz A. Qureshi" wrote:

What looping code would display dialog boxes, one after the other,
displaying
the names of the Sheets which are selected/grouped?
--
Best Regards,

Faraz





All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com