A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

a sample question about excel VBA



 
 
Thread Tools Display Modes
  #1  
Old November 1st, 2004, 02:01 AM
¬f©÷
external usenet poster
 
Posts: n/a
Default a sample question about excel VBA

How can I make msgbox like this?
¡÷ there are X sheets of this workbook
the first page name is : Sheets(1).Name
the secod page name is : Sheets(2).Name
¡õ until to the last page
the X page mane is : Sheets(X).Name


How can I write this module?


  #2  
Old November 1st, 2004, 02:35 AM
Gary Brown
external usenet poster
 
Posts: n/a
Default

Sub WorksheetNames()
Dim i As Long
Dim strAnswer As String

strAnswer = _
"There are " & Worksheets.Count & _
" sheets of this workbook"

For i = 1 To Worksheets.Count
strAnswer = strAnswer & vbCr & _
"Sheet " & i & " : " & _
Application.Worksheets(i).Name
Next i

MsgBox strAnswer

End Sub

Hope this helps

"¬f©÷" wrote in message
...
How can I make msgbox like this?
¡÷ there are X sheets of this workbook
the first page name is : Sheets(1).Name
the secod page name is : Sheets(2).Name
¡õ until to the last page
the X page mane is : Sheets(X).Name


How can I write this module?




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows in Taskbar Chevy General Discussion 8 October 15th, 2004 03:57 PM
Question regading use of the Excel object library robodale Worksheet Functions 2 September 7th, 2004 04:59 PM
Linked Excel file question. HeyMoe! General Discussion 1 September 2nd, 2004 01:51 PM


All times are GMT +1. The time now is 03:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.