Range < - > String conversion.

  • Thread starter Thread starter y
  • Start date Start date
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.
 
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
 
Hi Frank,

thanks for your tips.

Just a question:

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

Alex.
 
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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top