+ Reply to Thread
Results 1 to 4 of 4

how to select cell range with form?

  1. #1
    Registered User
    Join Date
    06-21-2006
    Posts
    4

    Question how to select cell range with form?

    How do I make a form that has 2 fields that user can define the range of cells they want to select? For example, if the user enter A1 in the first field, and C3 in the second field, and press the OK button, the cells from A1 to C3 (A1:C3) will be selected?

    Thank you very much.

  2. #2
    Registered User
    Join Date
    06-21-2006
    Posts
    4
    ok, I figured it out.

    Please Login or Register  to view this content.

  3. #3
    Norman Jones
    Guest

    Re: how to select cell range with form?

    Hi JagExcel,

    Try something like:

    '=============>>
    Public Sub Tester()
    Dim rng As Range

    On Error Resume Next
    Set rng = Application.InputBox _
    (Prompt:="Select the required range", _
    Type:=8)
    On Error GoTo 0

    If Not rng Is Nothing Then
    ' do something e.g:
    rng.Interior.ColorIndex = 6
    Else
    MsgBox "You cancelled"
    End If

    End Sub
    '<<=============


    ---
    Regards,
    Norman



    "jagexcel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > How do I make a form that has 2 fields that user can define the range of
    > cells they want to select? For example, if the user enter A1 in the
    > first field, and C3 in the second field, and press the OK button, the
    > cells from A1 to C3 (A1:C3) will be selected?
    >
    > Thank you very much.
    >
    >
    > --
    > jagexcel
    > ------------------------------------------------------------------------
    > jagexcel's Profile:
    > http://www.excelforum.com/member.php...o&userid=35657
    > View this thread: http://www.excelforum.com/showthread...hreadid=554395
    >




  4. #4
    Registered User
    Join Date
    06-21-2006
    Posts
    4
    Thanks a lot, Norman.

+ 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