ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Input Box (https://www.excelbanter.com/setting-up-configuration-excel/62905-input-box.html)

dddivers

Input Box
 
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.

Bob Phillips

Input Box
 
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)

"dddivers" wrote in message
...
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.




dddivers

Input Box
 
Fantastic! Thank you.

"Bob Phillips" wrote:

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)

"dddivers" wrote in message
...
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.






All times are GMT +1. The time now is 11:18 PM.

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