VBA Dialog Box --

  • Thread starter Thread starter JoLeigh
  • Start date Start date
J

JoLeigh

I'd like to create a dialog box in which the user would input a matrix of
numbers. I'd like the user to be able to copy and paste this information
rather than type in each entry individually.

I'm a VBA Newbie and clueless.

Thanks much,
JoLeigh
 
Perhaps if you explained your objective, someone could offer an alternative
method. What you have described does not seem practical since after the
macro begins, copying and pasting becomes a little sticky. The key term
matrix implies a set of values that may interact with each other. Pasting a
matrix into a dialog box will only create a text entry without any
interactive capability other than as a value of the dialog box per se. So
think about it and see if you can explain what your end quality product
should be.
 
Assuming the list of numbers to copy is in a range of cells.

Dim srng As Range
Set srng = Application.InputBox(prompt:= _
"Select The Range of Cells", Type:=8)

now do something with the values from srng


Gord Dibben MS Excel MVP
 
I'm creating an excel tool that will manipulate data from the user and am
using VBA to develop the front end and back end.
One input will be a pivot table created from an Access database that
provides information for each hour of each day -- i.e. a 24 x 7 matrix.
Does this make sense?
Thanks.
 
I'll try it -- thanks.

Gord Dibben said:
Assuming the list of numbers to copy is in a range of cells.

Dim srng As Range
Set srng = Application.InputBox(prompt:= _
"Select The Range of Cells", Type:=8)

now do something with the values from srng


Gord Dibben MS Excel MVP
 
I thihk you would be better off just putting the Access data into a grid on a
worksheet and working from there rather than trying to use a dialog box.
But, there are those wiser than me that could have a better recommendation.
My reasoning is that there is no way known to me that you can controll the
individual values of the grid if you put them in a text frame, a multipage or
any other type control, except possibly a combobox. But even in the combobox
you would have to use some complex code to pick out the individual values and
work with them. I just think that it is much easier to work with a matrix
from a worksheet grid.
 
Back
Top