+ Reply to Thread
Results 1 to 4 of 4

Help selecting a range in vba from userform inputs

  1. #1
    Registered User
    Join Date
    06-01-2004
    Posts
    2

    Help selecting a range in vba from userform inputs

    I have already created the form and can make the inputs select a cell. but i cannot seem to select a range.
    The user enters a row and i want to select that row from column b to column s.
    I am using
    Cells(orderlineBox.Value, 2).Activate
    to select the row and column 2 (B).
    How do i select the range??

    Please help..

  2. #2
    Zack Barresse
    Guest

    Re: Help selecting a range in vba from userform inputs

    Hi,

    Why do you want to Select anything? No real need for it. But here is the
    syntax...

    Range("B" & orderlineBox.Value & ":S" & orderlineBox.Value).Activate

    ... or ..

    Range(Cells(orderlineBox.Value, 2), Cells(orderlineBox.Value, 19)).Activate

    HTH

    --
    Regards,
    Zack Barresse, aka firefytr



    "grievesy" <grievesy.26xxtu_1146171352.7803@excelforum-nospam.com> wrote in
    message news:grievesy.26xxtu_1146171352.7803@excelforum-nospam.com...
    >
    > I have already created the form and can make the inputs select a cell.
    > but i cannot seem to select a range.
    > The user enters a row and i want to select that row from column b to
    > column s.
    > I am using
    > Cells(orderlineBox.Value, 2).Activate
    > to select the row and column 2 (B).
    > How do i select the range??
    >
    > Please help..
    >
    >
    > --
    > grievesy
    > ------------------------------------------------------------------------
    > grievesy's Profile:
    > http://www.excelforum.com/member.php...o&userid=10120
    > View this thread: http://www.excelforum.com/showthread...hreadid=537011
    >




  3. #3
    Registered User
    Join Date
    06-01-2004
    Posts
    2
    Thanks for your help..
    I actually just used the following
    Cells(orderlineBox.Value, 2).Activate
    Selection.Resize(, 18).Select
    Cheers

  4. #4
    Zack Barresse
    Guest

    Re: Help selecting a range in vba from userform inputs

    Can you tell us what it is you are trying to do? There's little need - if
    any - to Select anything in VBA. Generally and usually it's a waste of
    resources and only slows your operation down.

    --
    Regards,
    Zack Barresse, aka firefytr



    "grievesy" <grievesy.26xyzd_1146172806.5291@excelforum-nospam.com> wrote in
    message news:grievesy.26xyzd_1146172806.5291@excelforum-nospam.com...
    >
    > Thanks for your help..
    > I actually just used the following
    > Cells(orderlineBox.Value, 2).Activate
    > Selection.Resize(, 18).Select
    > Cheers
    >
    >
    > --
    > grievesy
    > ------------------------------------------------------------------------
    > grievesy's Profile:
    > http://www.excelforum.com/member.php...o&userid=10120
    > View this thread: http://www.excelforum.com/showthread...hreadid=537011
    >




+ 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