|
-
Apr 28th, 2003, 09:19 AM
#1
Thread Starter
New Member
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
-
Apr 28th, 2003, 09:23 AM
#2
PowerPoster
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:
Dim INTNEXT As Integer, INTMAX As Integer
INTMAX = Sheets.Count
For INTNEXT = 4 To INTMAX
Sheets(INTNEXT).Select
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
' SET CELL BACK TO HOME
Range("A1").Select
' SELECT THE EQUIPMENT SHEET
Sheets("ALLEQUIPMENT").Select
Range("A2").Select
If Range("A2") <> "" Then
' DO THE END DOWN STUFF
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Activate
End If
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
' LOOP TO THE NEXT SHEET
Next
' END UP ON EQUIPMENT SHEET
Sheets("ALLEQUIPMENT").Select
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|