LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Within the same procedure, can such Inputbox be used more than onc

I use Sub SelectRange() to identify user range. But it keeps returning the
same range even though we get to select range for 3 separate times. If it is
not possible to re-use Sub SelectRange() more than once within the same
procedure, then pls teach me a way to do so.

In summary, my main procedure needs 3 input from users(range is chosen by
users). If possible, pls allow users to select range using inputbox.

Thanks a lot.

Option Explicit
Dim UserRange As Range

Private Sub MainProc()
Call SelectRange
€¦.[ instruction_1]
Call SelectRange
€¦.[ instruction_2]
Call SelectRange
€¦.[ instruction_3]
End Sub


Private Sub SelectRange()
Dim DefaultRange As String
DefaultRange = Selection.Address
On Error GoTo Terminate
Set UserRange = Application.InputBox _
(Prompt:="Show me which Item Number to work on?", _
Title:="Select Range", _
Default:=DefaultRange, _
Type:=8)
UserRange.Select
Exit Sub
Terminate:
End Sub


--
Edmund
(Using Excel XP)
 
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
Stop a Procedure from another procedure Ayo Excel Discussion (Misc queries) 1 October 30th 08 01:42 AM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
Calling a procedure in a procedure Norman Jones Excel Programming 8 August 20th 04 07:53 PM
Calling a procedure in a procedure Don Guillett[_4_] Excel Programming 1 August 17th 04 11:31 PM


All times are GMT +1. The time now is 06:52 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"