Results 1 to 2 of 2

Thread: Msg Box Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    3

    Cool Msg Box Help

    Can someone help me with this.
    On my main excel screen, i am doing a command button that when pressed opens a message box that will list the cell values from other worksheets.

    Also, i would like to have a total value, in other words, can i have a line that does the math to add these together.

    Thanks in advance for the help. I am looking forward to utililizing VB for many needs.

    Thanks,

    Mel

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    You want to display values in MSGBOX in VB?

    This is a verys basic examp,e on how to loop thru tabs in Excel. Note : This example copies data form each tab to a main list, but may get you started....

    VB Code:
    1. Dim INTNEXT As Integer, INTMAX As Integer
    2.    
    3.     INTMAX = Sheets.Count
    4.    
    5.     For INTNEXT = 4 To INTMAX
    6.    
    7.         Sheets(INTNEXT).Select
    8.    
    9.         Range("A3").Select
    10.    
    11.         Range(Selection, Selection.End(xlToRight)).Select
    12.    
    13.         Range(Selection, Selection.End(xlDown)).Select
    14.        
    15.         Selection.Copy
    16.        
    17.         ' SET CELL BACK TO HOME
    18.    
    19.         Range("A1").Select
    20.        
    21.         ' SELECT THE EQUIPMENT SHEET
    22.        
    23.         Sheets("ALLEQUIPMENT").Select
    24.        
    25.         Range("A2").Select
    26.    
    27.         If Range("A2") <> "" Then
    28.        
    29.             ' DO THE END DOWN STUFF
    30.        
    31.             Selection.End(xlDown).Select
    32.            
    33.             ActiveCell.Offset(1, 0).Activate
    34.        
    35.         End If
    36.    
    37.         Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    38.         False, Transpose:=False
    39.        
    40.     ' LOOP TO THE NEXT SHEET
    41.    
    42.     Next
    43.    
    44.     ' END UP ON EQUIPMENT SHEET
    45.    
    46.     Sheets("ALLEQUIPMENT").Select
    47.    
    48.     Range("A2").Select

    I have this running as a macro in Excel, but could easily be changed to work in VB...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

Posting Permissions

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



Click Here to Expand Forum to Full Width