Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dialog for selecting range within subroutine
Excel 2007
Is there a dialog which I can call within a subroutine which would ask the user to select with the mouse a range of cells and place the result in a variable? Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dialog for selecting range within subroutine
Sub rng()
Set myRange = Application.InputBox("Enter a range or " _ & "select a range with the mouse.", _ "SELECT A RANGE", Type:=8) MsgBox myRange.Address End Sub "John" wrote in message ... Excel 2007 Is there a dialog which I can call within a subroutine which would ask the user to select with the mouse a range of cells and place the result in a variable? Thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dialog for selecting range within subroutine
Excel 2007
Dialog for selecting range Is there a dialog which I can call within a subroutine which would ask the user to select with the mouse a range of cells and place the result in a variable? http://www.ozgrid.com/forum/showthread.php?t=64872 Is there a built-in dialog box that allows the user to select a range by clicking and dragging with the mouse? I'd like to use this in my code and have the dialog box return either a range object or and address that I can use in a range assignment statement. I'm looking for something like what you get when you select Insert--Name--Define. The "Refers To" text box at the bottom automatically updates as the user clicks and drags across cells. Is there such a thing accessible via VBA? Answer http://msdn.microsoft.com/en-us/library/bb209950.aspx Dim rng As Range Set rng = Application.InputBox("Select cell(s)",type:=8) Note : VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
deleting cell range in a worksheet_change subroutine | Excel Programming | |||
Worksheet Cell Range Name within VB Subroutine | Excel Discussion (Misc queries) | |||
Selecting a file from dialog | Excel Programming | |||
subroutine to get all of the Named range properties | Excel Programming | |||
Selecting Cells using dialog box | Excel Programming |