+ Reply to Thread
Results 1 to 5 of 5

Trying to select rows

  1. #1
    Arne Hegefors
    Guest

    Trying to select rows

    Ok i have a problem that I dont understand. I guess its easy if you know it
    but I dont and its really bugging me..I try to select several rows by writing:

    startRow = relativCell.Offset(k, 0).Row
    endRow = relativCell.Offset(j, 0).Row

    Rows(startRow, endRow).Select

    this is obviously wrong but how do you write it? The two first lines are
    correct but the line RoWs(.....).Select is faulty inside the parenthisis.
    Please help me out if you know this!!!


  2. #2
    Ardus Petus
    Guest

    Re: Trying to select rows

    Range(Rows(startRow),Rows(endRow)).Select

    HTH
    --
    AP

    "Arne Hegefors" <[email protected]> a écrit dans le
    message de news: [email protected]...
    > Ok i have a problem that I dont understand. I guess its easy if you know
    > it
    > but I dont and its really bugging me..I try to select several rows by
    > writing:
    >
    > startRow = relativCell.Offset(k, 0).Row
    > endRow = relativCell.Offset(j, 0).Row
    >
    > Rows(startRow, endRow).Select
    >
    > this is obviously wrong but how do you write it? The two first lines are
    > correct but the line RoWs(.....).Select is faulty inside the parenthisis.
    > Please help me out if you know this!!!
    >




  3. #3
    Newbie
    Guest

    RE: Trying to select rows

    Rows(startRow & ":" & endRow).Select

    "Arne Hegefors" wrote:

    > Ok i have a problem that I dont understand. I guess its easy if you know it
    > but I dont and its really bugging me..I try to select several rows by writing:
    >
    > startRow = relativCell.Offset(k, 0).Row
    > endRow = relativCell.Offset(j, 0).Row
    >
    > Rows(startRow, endRow).Select
    >
    > this is obviously wrong but how do you write it? The two first lines are
    > correct but the line RoWs(.....).Select is faulty inside the parenthisis.
    > Please help me out if you know this!!!
    >


  4. #4
    Arne Hegefors
    Guest

    RE: Trying to select rows

    thanks for your help. look i am extremely bad at vba and especially cell
    refenernces. i tried bopth your code and it did nor work. do i have to define
    startRow and endRow as something special (int, var, range). I have spent over
    two hours on this one single line.....i desperatly need help!!!

    "Newbie" skrev:

    > Rows(startRow & ":" & endRow).Select
    >
    > "Arne Hegefors" wrote:
    >
    > > Ok i have a problem that I dont understand. I guess its easy if you know it
    > > but I dont and its really bugging me..I try to select several rows by writing:
    > >
    > > startRow = relativCell.Offset(k, 0).Row
    > > endRow = relativCell.Offset(j, 0).Row
    > >
    > > Rows(startRow, endRow).Select
    > >
    > > this is obviously wrong but how do you write it? The two first lines are
    > > correct but the line RoWs(.....).Select is faulty inside the parenthisis.
    > > Please help me out if you know this!!!
    > >


  5. #5
    Jim Thomlinson
    Guest

    RE: Trying to select rows

    Why not do it all in one line since you have the range objects anyways...

    Range(relativCell.Offset(k, 0), relativCell.Offset(j, 0)).EntireRow.Select
    --
    HTH...

    Jim Thomlinson


    "Arne Hegefors" wrote:

    > Ok i have a problem that I dont understand. I guess its easy if you know it
    > but I dont and its really bugging me..I try to select several rows by writing:
    >
    > startRow = relativCell.Offset(k, 0).Row
    > endRow = relativCell.Offset(j, 0).Row
    >
    > Rows(startRow, endRow).Select
    >
    > this is obviously wrong but how do you write it? The two first lines are
    > correct but the line RoWs(.....).Select is faulty inside the parenthisis.
    > Please help me out if you know this!!!
    >


+ 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