Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default How do program a prompt in excel 97?

Unday,

This will prompt the user where to paste. The user can type in a range, or
select it with the mouse:

Sub test()
Dim paste_range As Range

'"type := 8" means that it only accepts a range as input
Set paste_range = Application.InputBox(prompt:="Where to paste data?",
Type:=8)
Worksheets("Sheet1").Range("A1:A5").Copy _
Destination:=paste_range
End Sub

hth,

Doug Glancy

"Unday" wrote in message
...
In Lotus 1-2-3 I was able to program into a macro to promp for data(i.e. a
range to copy data to). I haven't been able to do that in excel 97. I

know
there must be a way. Can anyone help me?

Regards,

Unday



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do program a prompt in excel 97?

Doug give excellent advice. Just some added info. this will raise an error
if the user hits cancel, so

Sub test()
Dim paste_range As Range

'"type := 8" means that it only accepts a range as input
On Error Resume Next
Set paste_range = Application.InputBox( _
prompt:="Where to paste data?", Type:=8)
On Error Resume Next
if paste_range is nothing then
msgbox "You hit cancel"
Exit sub
end if
Worksheets("Sheet1").Range("A1:A5").Copy _
Destination:=paste_range
End Sub

--
Regards,
Tom Ogilvy

"Doug Glancy" wrote in message
...
Unday,

This will prompt the user where to paste. The user can type in a range,

or
select it with the mouse:

Sub test()
Dim paste_range As Range

'"type := 8" means that it only accepts a range as input
Set paste_range = Application.InputBox(prompt:="Where to paste data?",
Type:=8)
Worksheets("Sheet1").Range("A1:A5").Copy _
Destination:=paste_range
End Sub

hth,

Doug Glancy

"Unday" wrote in message
...
In Lotus 1-2-3 I was able to program into a macro to promp for data(i.e.

a
range to copy data to). I haven't been able to do that in excel 97. I

know
there must be a way. Can anyone help me?

Regards,

Unday





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
How do program a prompt in excel 97? Frank Kabel Excel Programming 0 September 3rd 04 07:38 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"