Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Bypass: A program is trying to send mail using Item.Send prompt | Excel Discussion (Misc queries) | |||
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 | Excel Discussion (Misc queries) | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
How do program a prompt in excel 97? | Excel Programming | |||
merging excel program with tdc finance program | Excel Programming |