Results 1 to 4 of 4

InputBox selects active cell, not selected cells?

Threaded View

  1. #1
    Registered User
    Join Date
    01-14-2010
    Location
    Stockholm
    MS-Off Ver
    Excel 2007
    Posts
    2

    InputBox selects active cell, not selected cells?

    I am trying simply to select a range with Application.InputBox method. It does ask to select the range and correctly specify it in a pop up window, but in reality it selects only the active cell (see two attached screen shorts, MsgBox shows number of selected counts). What is wrong?

    I work with Excel 2007 on WinXP.

    Thank you very much in advance!

    The code is :

    ===================================
    Public Sub ProblemWithInputBox()
    
    Dim UserRange As Range
    
    Prompt = "Select one column range to make list of categories"
    Title = "Select a range"
    
    On Error Resume Next
    Set UserRange = Application.InputBox( _
        Prompt:=Prompt, _
        Title:=Title, _
        Type:=8)
    On Error GoTo 0
    
    MsgBox Selection.Count
    
    End Sub 
    =================================
    Attached Images Attached Images
    Last edited by DonkeyOte; 01-15-2010 at 04:01 AM. Reason: tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1