ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA INPUTBOX() - Please Help (https://www.excelbanter.com/excel-programming/304897-excel-vba-inputbox-please-help.html)

bob

Excel VBA INPUTBOX() - Please Help
 
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

Frank Kabel

Excel VBA INPUTBOX() - Please Help
 
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


Tom Ogilvy

Excel VBA INPUTBOX() - Please Help
 

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




Bob[_59_]

Excel VBA INPUTBOX() - Please Help
 
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





Tom Ogilvy

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







bob

Excel VBA INPUTBOX() - Please Help
 
Thanks, very Much Tom, I've just learned a great deal
about arrays Lbound and Ubound.... So much more to learn..

This works great, I did need to add
DIM i, j as Variant
Am I wrong in assuming that Variant is a most general and
useful category, unless you need to do something specific
with a variable like calculations ...??
Thank you, and all the others again for all your time and
assistance..
-----Original Message-----
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






.


bob

Excel VBA INPUTBOX() - Please Help
 
OK I Thought I would be able to figure this out, but I was
WRONG...
How do I allow the selection of the cell where this can be
pasted into???

Have been trying to use INPUTBOX, but I can not find where
the cell reference is stored in that function.... ???

-----Original Message-----
Thanks, very Much Tom, I've just learned a great deal
about arrays Lbound and Ubound.... So much more to learn..

This works great, I did need to add
DIM i, j as Variant
Am I wrong in assuming that Variant is a most general and
useful category, unless you need to do something specific
with a variable like calculations ...??
Thank you, and all the others again for all your time

and
assistance..
-----Original Message-----
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





.

.


Tom Ogilvy

Excel VBA INPUTBOX() - Please Help
 
a reference to the cell selected is held by mycell.

--
Regards,
Tom Ogilvy

"Bob" wrote in message
...
OK I Thought I would be able to figure this out, but I was
WRONG...
How do I allow the selection of the cell where this can be
pasted into???

Have been trying to use INPUTBOX, but I can not find where
the cell reference is stored in that function.... ???

-----Original Message-----
Thanks, very Much Tom, I've just learned a great deal
about arrays Lbound and Ubound.... So much more to learn..

This works great, I did need to add
DIM i, j as Variant
Am I wrong in assuming that Variant is a most general and
useful category, unless you need to do something specific
with a variable like calculations ...??
Thank you, and all the others again for all your time

and
assistance..
-----Original Message-----
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





.

.





All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com