Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2008

Tip: Looking for answers? Try searching our database.

How do you do a range selection dialog like those many in Excel?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LunaMoon - 31 Jul 2008 15:28 GMT
Hi all,

I want to select some range dynamically, including multiple selection,
via showing a range selection dialog...

Hopefully there are some dialog functions that I can use...

How to do that in VBA?

Thanks!
John Bundy - 31 Jul 2008 15:45 GMT
There is a RefEdit control for the toolbar, add it if you don't have it
already by selecting More Controls (hammer and wrench icon) and select
RefEdit. You need to have a userform up to do this in VB, right click on your
project and add Userform, the toolbox will appear.
Signature

-John
Please rate when your question is answered to help us and others know what
is helpful.

> Hi all,
>
[quoted text clipped - 6 lines]
>
> Thanks!
XP - 31 Jul 2008 16:22 GMT
Another way; this just uses an input box...

Copy the following into a standard code module and run the first one (you
will need to correct for line wrap):

Sub TESTIT()

Dim sAddress As String
sAddress = InputBoxRange

MsgBox "The selection was: " & sAddress

End Sub

Public Function InputBoxRange() As String
Dim rngResponse As Range
Dim strMsg As String
Dim intConfirm As Integer
On Error Resume Next
Do
   Set rngResponse = Application.InputBox("Type or select a range of
cells:", "RANGE VALIDATION", Selection.Address, , , , , 8)
   If Err.Number <> 0 Then Err.Clear: End
   rngResponse.Select
   intConfirm = MsgBox("Is the following selection correct?" & vbCr & vbCr
& rngResponse.Address, vbQuestion + vbYesNo, "CONFIRM SELECTION")
   If intConfirm = 6 Then Exit Do  'YES
Loop
InputBoxRange = rngResponse.Address
End Function

> Hi all,
>
[quoted text clipped - 6 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.