Range < - > String conversion.

Y

y

Is there an automatic conversion?
I must ask the user for a range but the input box returns a string.

I check for "conversion" inside VBA help and I find out nothing.

Thanks Alex.
 
F

Frank Kabel

Hi
use the application.inputbox with the type:=8. e.g.

Sub foo()
....
Dim aralik As Range
On Error Resume Next
Set aralik = Application.InputBox(prompt:="Select range:", Type:=8)
If Err <> 0 Then
Exit Sub
End If
On Error GoTo 0
' your code
....
End Sub
 
Y

y

Hi Frank,

thanks for your tips.

Just a question:

why Set aralik = Application.Inp... ? and not aralik = Application.Inp...

Alex.
 
F

Frank Kabel

Hi
you want to get a range (which is an object) For object assignments you
nee set.
e.g. the following won't work:
dim rng as range
rng = range ("A1:A2")

but the following will
dim rng as range
set rng = range ("A1:A2")
 
Top