Input Box

G

Guest

I'm trying to create a VBA scenario in Excel 2003 where an Input Box appears
asking the user to type a desired cell range (e.g. A1:B6) from a specified
worksheet (e.g. Sheet1) in the Input Box, and then have the values that sit
in whatever cell address range the user typed in the Input Box to copy and
paste to another specified worksheet (e.g. Sheet2). In other words, if the
user types A1:B6 in the Input Box, the VBA will copy and paste the values in
cells A1 thru B6 in sheet 1 over to sheet2 starting in cell A4. I have some
of the code hammered out but am stuck. Any suggestions? Thank you.
 
B

Bob Phillips

Rather than get them to type it in, use

Set rng = Application.Inputbox("Select range",Type:=8)

which allows them to select the range with the mouse. You can then simply
copy that range

rng.Copy Worksheets("other").Range"A1")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
G

Guest

Fantastic! Thank you.

Bob Phillips said:
Rather than get them to type it in, use

Set rng = Application.Inputbox("Select range",Type:=8)

which allows them to select the range with the mouse. You can then simply
copy that range

rng.Copy Worksheets("other").Range"A1")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Top