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?


0
jazzcarr1 (2)
11/1/2004 2:01:07 AM
excel.newusers 15348 articles. 2 followers. Follow

1 Replies
777 Views

Similar Articles

[PageSpeed] 4

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��" <jazzcarr@yahoo.com.tw> wrote in message 
news:OHbPTc7vEHA.344@TK2MSFTNGP10.phx.gbl...
> 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?
>
> 


0
11/1/2004 2:35:38 AM
Reply:

Similar Artilces:

Visible Question
I want to make a control to become Visible if in the third Column of my list box[lstModify] shows an "e" ,when I select a row I want the control to be visible The Control now is set no Visible/No Me.cmdEmail.Visible = IIf(IsOwnerWithEmail(Nz(Me.lstModify.Column(3), 0)) _ And IsEmailOn, True, False) Case Else Me.cmdEmail.Visible = False ------------------------------------- I have already a togggle button to email or not: Private Sub cmdSendMail_Click() If cmdSendMail.value = True Then cmdSendMail.Caption = "Send Email" Else ...

find question on vba
Hi All I define two find 1. Find Key 2. Find Item In find key, the cell formula is =G2&"|"&V3&"|"&J2. I check the data, the find can not able to find a key value. The key value is on target sheet. But the find return nothing. What is the problem on data case return nothing ? With GP_WK.Sheets(MES.SHT_Name).Range(MES.KEY_RANGE) Set Rng_KEY = .Find(What:=GPD_KEY_VAL, _ After:=.Cells(1), _ LookIn:=xlValue, _ LookAt:=xlWhole, _ ...

Some questions re VBA in Excel
Hi, I'm relatively new to using VBA in Excel and hope that someone can help me with the following: 1. I have written some scripts that work in one workbook but open another for reading data. In order to make sure that this file is never corrupted I close the file at the end of my scripts and make sure that any changes are discarded: Workbooks(dsName).Close SaveChanges:=False Unfortunately I still get the message concerning a large amount of stuff being in the clipboard and do I want to save it, Yes/No/Cancel? I want to protect the user from this question (not least because the Canc...

Mac Excel 2008 cannot open Windows Excel 2007 Files
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Every so often my Mac Excel 2008 cannot open files from Window Excel 2007. The message I get is: <br> &quot;Excel cannot open this file. The file may have been damaged or modified from it original format&quot; <br><br>This problem appears and disappears and the cycle keeps repeating. I do not see any workable solutions so far in this forum. <br><br>Please help! In article <59baff7a.-1@webcrossing.JaKIaxP2ac0>, Shayp@officeformac.com wrote: > Version: 2008 ...

How to lock a line put on a graph in excell
I am trying to attach a line to a graph with months on the X axis. When I add additional months I want the line to stay in between the original months, however, it always moves as the graph expands. Drawing objects cannot be linked to specific values of chart axes, unless you incorporate them as series in the chart. Try the techniques here: http://peltiertech.com/Excel/Charts/AddLine.html - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Dennis" <Dennis@discussions.microsoft.com> wrote in message news:336...

XP Pro question
I'm considering buying a Full version Windows XP Professional in anticipating an advance to Windows 7. (Have no previous Windows products). I don't know if the version has any Service Packs. If it doesn't can I still get them, or is support for professional expired? As an aside, what version of Windows 7 do I need for a system that has never had a Microsoft product? Thanks. On Apr 5, 4:07=A0pm, Motort <u...@domain.invalid> wrote: > =A0 =A0 =A0 =A0 I'm considering buying a Full version Windows XP Professi= onal in > anticipating an advance to Windows ...

Excel Icon #2
I have an Excel icon which has a lower case 'a' in it, what does this mean? Thanks, Zetor There are a number of icons that contain a lowercase a, but if the one you are talking about has a white background and a couple of little arrows either side of it, then it is the merge and center icon. By selecting a range of cells, this icon will merge them and centre justify any data that goes in it. You should be able to hover your mouse over the icon and have it tell you what icon it is. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec...

Send To from Excel
Since moving to Windows and Office 2000, the Send To, Mail Recipient option does not allow me to select a name from our Global Address List. Instead a 'Select Recipient' screen is displayed with the option to select from 'Main Identities Contact' or 'Shared Contact'. When sending emails using MS Outlook, our user can see the the Global address list. This problem only occurs when sending an email through Excel, Word ...

excel
Hello, is it by importing a excel-table to visio to import also the name of the excel-sheet as headline or name of the sheet? Thanks - Angelika ...

*Hi- Urgent (but of course) I need a music cue sheet in excel format....(sample attached)......thanks for the help!
Anyone that can help me create a excel file such as this The end user will need to open it in excel (microsoft).... Have a look at this example.....its PDF, but you can see at the bottom, the table/cells are present allowing the end user to input the data. Looking for advice, someone needs me to make them a cue sheet ASAP! Here is the sample I am talking about: http://www.westarmusic.com/pdf/wsr-comp-cuesheet.pdf I do not use Excel enough to make this work, I am making a mess of it. thanks again! On Mon, 16 Jan 2006 10:08:02 -0800, "musicfirst@yahoonospam.com" <musicfirst@...

Extending Pricing Question and U of M
Quick question(s) for a newbie... In the price sheet detail maintenance screen (extending pricing most everything net pricing), for a particular item, what does the "based on U of M" drop down box do? Does it default the SOP entry of items to that particular U of M? In other words, if I have price sheet # 1 assigned to customer "1", and I select "case", when I bring up a SOP order does it default customer 1 to "case"? What about the selection of "U of M"? does it use the price sheet default or something else? ...

question on horizontal line on chart
Excel 2003 :) Ok, I'm able to put a horozontal line on my chart but now I'm trying to make it change... I have a chart (standard clustered column)that shows YTD values from several sources with a horizontal line showing the average of them all. (instructions for adding line from peltiertech.com - thanks Jon!) Here's my problem. These are year to date numbers so they change monthly and so does the average. In the x,y range in my worksheet for the horizontal line, I tried linking the number to the average, and it appears to work - the numbers for 0 and 1 change when the ave...

Re: Excel Lossing Information
I have an excel document that I update everyday which has over 1200 lines to it and 10 columns. I am noticing when I update my information, other information becomes lost or missing. I am wondering if you have notice that excel has a breaking point. That it will only process or hold so many lines and columns. I have both XP and 2003 that I use to update. I've never noticed excel dropping information from my files. I have noticed that when I lose info, it's usually my mistake or the mistake of one of the people who edited the file. And any chance you have two versions of the wo...

CListCtrl questions
Hi, I am developping on Pocket pc and smartphone and I have a few questions about CListCtrl in report mode. First how can I know how many items I can display without having a vertical scrollbar? On smartphone we are using keypad to move, so first time when I press down key, the curent selection doesn't move.It's only the second time I press the key that is starts to move. First I thought it was a focus problem but even with the focus, it still the same. I also tried to select the first line first with a setitemstate but same result.any idea ? Last question is once a clistctrl h...

Problem opening e-mail attached Excel files
I have started having problems opening Excel files that come attached to e-mails when I double click on them in the e-mail or from the file page icon(when the attached Excel file has been saved). I am getting the following message: "Cannot find the file xxxx.xls(or one of its components). Make sure the path and file name are correct and that all required libraries are available." I have this problem from Zipped Excel files too. I do not appear to have the problem when I open them directly from Excel. Also, I do not appear to have any problems with other types of files(.doc, .pd...

CRM 3.0
This is just a user question. In an Account, in More Addresses I created a Bill To and a Ship To address. Then in a Contact I created and Opportunity. From this Opportunity I then created a Quote. On the quote form on the Addresses tab, I clicked the Lookup Adresses button, checked Bill To, clicked the Lookup button and all I see is the main Account Address, not the two addresses - Bill To and Ship to. Have I done something wrong? Or do I have to retype the Bill To and Ship To addresses in each new Contact as I create it? Thanks! Shauna In V3.0 additional addresses from accounts doe...

Counting with Excel
I want to count the number of times a name appears in one column, if the date in another column falls in a certain period. For instance: Count If A1:A5=B OP and the date in B1:B5 is between 01/04/05 & 17/04/05. ColA ColB B OP 15/04/05 B LD 15/04/05 B OP 13/04/05 B OP 18/04/05 B PD 13/04/05 with the answer being 2! The way the sheet is set up will not work in a pivot table (I don't think) and i don't want to alter it. I've tried someproduct but can't get it to work, i'm either writing it wrong or using the wrong f...

A question about PCM wave file.
Hi all. I have a 8bits PCM wave file and I want to convert it to 16Bits PCM wave file. I use the following formula 16Bits_sample = (8Bits_sample - 128)<<8. Affter converting there is some noise in 16Bits PCM wave file. Is my formula is correct? and Does anybody have another method to reduce the noise? Please help me. Thanks and best regard. You shouldn't need to do the subtraction. char samp8; short samp16; .... samp16 = (short)samp8 << 8; .... "Binh Nguyen Van" wrote: > Hi all. > > I have a 8bits PCM wave file and I want to convert it to 16Bits P...

Generating a list from Excel 2003
Hi, I would like to know how to generate a list from data in Excel 2003. I would like this list to be generated and put into a document such as Word or some other form. My Sheet has Headings such as First Name, Last Name, Address, Pass (which will bwe checked for some) Thank-you in advance for youe help If it is a table, you can simply copy and paste from Excel into MS Word. If you are trying to print labels with Excel as the database, you do that from MS Word and with the worksheet you want to use as the first worksheet (the first worksheet requirement may not be necessary in Excel...

Macro to lock VBA project
Hello Is it possible to have a macro that will: 1. under VBA project properties lock project for viewing 2. open input box to input password to view project properties. 3. save file /or prompt to save as. So in other words after you open vba project and play woth macros, work on file etc, one could just click a button and a input box to input password to lock VBA project would be opened. Afeter you input it the input box closes and saves the file or prompts save as if it is not saved yet? I tried to google it and record it but no luck... Anyone? Thank you Excel's VBA doesn't supp...

xml newbie question
We've have just reached a point where our program needs some type of Industry standard file format & XML seems the obvious choice Before I go rushing off and use the wrong system can anyone give a little advice Our files may be quite large but we will only use them for the - File-Open and File-Save options I am currently working in MFC but would like the opportunity to more to .NET later on I generally want to store human readable files but also some binary (bitmaps etc) We use the MFC serialisation which makes for easy programming but a hard life - is there an XML serialisatio...

Money 2002 or later Question
I have used MONEY 2002 since it was put on the market. I have never upgraded because that version does exactly what I need it to do and it doesn't want a passport account so it can put all my personal information onto the internet or Microsoft's computers. However, tonight something strange happened and because Microsoft documentation is difficult to find at best, I can not find out what I need to know. (Or maybe I should say 'would like to know.') I created a new account and started to enter a few past transactions that occurred over several months. At the end of ea...

Can't open excel or word documents (says insert sm bus cd?)
I have been running Windows XP for over a year without a problem, but now I can not open any of my Excel or Word or Outlook documents because it says that I need to insert my small business cd. I don't have that cd. This has happened once before and I just used my system restore function and it was fine, but that won't even work this time. HELP!! ~~Angela @ angela27@iglide.net ...

Questions from a Quicken user
I have a couple of questions regarding Money -- specifically, Money 2004. I'm a Quicken user, and have been since dirt was invented. However, I've tired of the unfixed bugs and Intuit's policies, and am seriously considering a switch to Money. I understand that Money 2004 will handle my Quicken 2003 data conversion. There are a couple of "features", however, that I use as well, and am wondering if Microsoft has any comparable vehicles. 1. Does MS have a webentry tool (similar to Quicken's Webentry feature?) 2. Does MS have an online viewing tool (similar to Qu...

SQL query question 06-04-07
Hi all, I have a SQL query question... I have a table with road segments that have a low and high address (see sample QUERY below) I am wanting to produce a report of the roads that meet the following... 1. [FROM_ADD] > 0 AND ( 2. the [FROM_ADD] > [TO_ADD] OR 3. if there is more than one segment with the same name... the [FROM_ADD] < the previous road segment with the same name's [TO_ADD] ) So if I ran it on the query below, I would end up with... AARONDALE ROAD Because third segment's [FROM_ADD] ...