Consulting

Results 1 to 8 of 8

Thread: Sleeper: Select range

  1. #1

    Sleeper: Select range

    hi
    im writing one macro
    wher user provides range manually, but i observed that they makes mistake in specifying range

    so any vba code wher user can select range by cursor as input & after that specify two different ranges say range a for one data output and say range b for other data output

    thanks in advance
    A mighty flame followeth a tiny sparkle!!



  2. #2
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    If you're in a form you could use a RefEdit control.

  3. #3
    Quote Originally Posted by BlueCactus
    If you're in a form you could use a RefEdit control.
    No im using just VBA macro wiyhout form.
    A mighty flame followeth a tiny sparkle!!



  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by excelliot
    No im using just VBA macro wiyhout form.
    Then use an application inputbox with a type of 8

    Dim rng as Range
    
        Set rng = Application.Inputbox("Select the target range with the mouse", Type:=8)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Aug 2004
    Location
    London, England
    Posts
    52
    Location
    Yegads!!! If only I'd known 3 years ago about this 'type' parameter!!!

    I've been writing excel vba for years but i've always just used Inputbox(...) and not Application.Inputbox(...), the first is a member of VBA.Interaction and doesn't let you specify type, so i've always had a hard time getting the user to specify a range. It never even occured to me that excel might offer its own inputbox so you can specify the return type!

    Am I alone in this folly or has anyone made this mistake??

  6. #6
    Moderator VBAX Mentor sheeeng's Avatar
    Joined
    May 2005
    Location
    Kuala Lumpur
    Posts
    392
    Location
    Quote Originally Posted by xld
    Then use an application inputbox with a type of 8

    Dim rng as Range
     
    Set rng = Application.Inputbox("Select the target range with the mouse", Type:=8)
    How to use Type?

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by sheeeng
    How to use Type?
    In VBA, there is a useful function called Help
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    Moderator VBAX Mentor sheeeng's Avatar
    Joined
    May 2005
    Location
    Kuala Lumpur
    Posts
    392
    Location
    Quote Originally Posted by xld
    In VBA, there is a useful function called Help
    Sorry, thanks.

    I have a look to it later...

Posting Permissions

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