Excel VBA INPUTBOX() - Please Help
Sub merge2()
Dim mycell As Variant
Dim t2 As Variant, sStr as Variant
Worksheets("Sheet1").Activate
Set mycell =
Application.InputBox(prompt:= _
"Select a cell", Type:=8)
t2 = mycell.Value2
for i = lbound(t2,1) to ubound(t2,1)
for j = lbound(t2,2) to ubound(t2,2)
sStr = sStr & t2(i,j) & ", "
Next j
sStr = Left(sStr, len(sStr)-2) & vbNewLine
Next i
Call MsgBox(sStr, vbOKOnly + _
vbExclamation + vbSystemModal + _
vbDefaultButton1, "Display Variable")
End Sub
--
Regards,
Tom Ogilvy
"Bob" wrote in message
...
Thanks... This is what I have now and
it goes through with out error
=======================
Sub merge2()
Dim mycell As Variant
Dim t2 As Variant
Worksheets("Sheet1").Activate
Set mycell =
Application.InputBox(prompt:="Select a
cell", Type:=8)
t2 = mycell.Value2
Call MsgBox(mycell.Value2, vbOKOnly +
vbExclamation + vbSystemModal +
vbDefaultButton1, "Display Variable")
End Sub
=====================
I can see values (in the locals window)
assigned to t2(n,n) where n is an array
value, Can you tell me now how to
capture those values one at a time to be
concatenated into one cell???
"Tom Ogilvy" wrote in
message
...
test =
mycell.cell.Value2.Value2(1).Value2(1,
1)
should be
test = mycell.Value2
--
Regards,
Tom Ogilvy
"Frank Kabel"
wrote in message
...
Hi
first try
changing the Dim statement to
Dim test As Variant
--
Regards
Frank Kabel
Frankfurt, Germany
Bob wrote:
In trying to find that data
recorded in this function I
am using TEST = so that I can see
it's value in the locals
window, as I step through the macro.
However it errors out on <test =
mycell.cell.Value2.Value2
(1).Value2(1, 1)
with ( run-time 438 object doesn't
support this property
or method)
I've also tried test =
mycell.Value2.Value2(1).Value2(1, 1)
Am I using the wrong variant
assignment???
Sub merge1()
Dim mycell As Variant
Dim test As String
Worksheets("Sheet1").Activate
Set mycell =
application.InputBox(prompt:="Select a
cell",
Type:=8)
test =
mycell.cell.Value2.Value2(1).Value2(1,
1)
test = mycell.FormulaHidden
End Sub
|