Computing.Net > Forums > Programming > Easy VBA "Range" question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Easy VBA "Range" question

Reply to Message Icon

Name: 24HG_Hoop
Date: March 8, 2008 at 10:58:41 Pacific
OS: XP
CPU/Ram: 3200/2G
Product: clone
Comment:

Easy enough, I'm trying to copy a template and let the user define where they was the template copied. The problem is in the Range statement. All of the help files say that the range has to be a cell reference, but the InputBox command says that you CAN ask for a range by adding the "type:=8" at the end of the InputBox statement.

Any ideas?


Sub COPY_TEMPLATE()
'
' COPY_TEMPLATE Macro
'

'
Range("A3:J33").Select
Selection.Copy
Set myRange = Application.InputBox(prompt:="What CELL do you want to put it in?", Type:=8)
Range("myRange").Select
ActiveSheet.Paste

End Sub



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: March 9, 2008 at 06:33:50 Pacific
Reply:

It returns a Range object. It'd be as if you typed:

Set myRange = Range(InputBox("What CELL do you want to put it in?"))

But with the added option of the user actually clicking on the cell he wants.

0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Easy VBA "Range" question

Easy VBA question.....I hope www.computing.net/answers/programming/easy-vba-questioni-hope/6625.html

New skills www.computing.net/answers/programming/new-skills/17189.html

Exzcel VBA dynamic range www.computing.net/answers/programming/exzcel-vba-dynamic-range/19754.html