Inserting table into MsgBox

dmorse03

Board Regular
Joined
Sep 7, 2002
Messages
59
I have a table which occupies

D10..e18

How do I display this table in a MsgBox or an InputBox?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
You could try something like this (you don't really need the set command, btw, but it might be easier to amend and debug with it in): -

Code:
Public Sub ShowTable()

Dim myData
Dim myStr As String
Dim x As Integer
Dim myRange As Range

Set myRange = Range("D10:E18")

myData = myRange.Value

For x = 1 To UBound(myData, 1)
    myStr = myStr & myData(x, 1) & vbTab & myData(x, 2) & vbCrLf
Next x

MsgBox myStr

End Sub
 

zuzzu

New Member
Joined
Mar 10, 2011
Messages
1
Hello everyone,

How can I insert a table(A1:I31) into msgbox when the excel file containing the table is CLOSED ? And I dont want to open the file.

If it's not possible by not opening, when i click for msgbox, the program can open the excel file (C:\table1.exe --> Fixed adress always) and then close.
 

Forum statistics

Threads
1,144,765
Messages
5,726,175
Members
422,660
Latest member
mrsteele

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top