+ Reply to Thread
Results 1 to 3 of 3

User Select Range Through Input Box

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    User Select Range Through Input Box

    Hi all,

    I'm trying to get a users' selected range to display in a cell as stored text.

    therefore, If a user selects A1:D7. The text in Cells("G", 10) will be:"A1:D7"

    w/o the quotes.

    I've attached an example workbook.
    Here's the formula thus far:

    Sub SelectRangeBox()
    Dim rnBody As Range
    Dim vaMsg As Variant
    Do
    vaMsg = Application.InputBox( _
    Prompt:="Please enter the message-text:", _
    Title:="Message", _
    Type:=2)
    Loop While vaMsg = ""

    On Error Resume Next
    Set rnBody = Application.InputBox("Please enter the range:", _
    , Selection.Address, , , , 8)
    If rnBody Is Nothing Then Exit Sub
    On Error GoTo 0
    With Sheets("Sheet1")
    Cells("G", 10).Value = rnBody.Text
    End With
    End Sub
    Actuall maybe my thread should be Titled. user selected cell range displayed in input box save to cell as a text value.
    Thanks,

    BDB
    Attached Files Attached Files
    Last edited by bdb1974; 09-21-2009 at 04:47 PM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: User Select Range Through Input Box

    I haven't really looked at your code very closely but, you should use something along these lines - adapt as needed for your code:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Re: User Select Range Through Input Box

    Palmetto.
    Great. Works Perfect.. Now to try and apply usage.


    Thanks

    BDB

+ Reply to Thread

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