Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default 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!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
select between rows zana Excel Discussion (Misc queries) 1 May 18th 09 11:56 PM
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
select rows [email protected] Excel Worksheet Functions 1 March 1st 06 03:57 AM
select block of rows w/data between blank rows Janna Excel Programming 6 February 13th 05 02:45 AM
Unable to select rows in the repeat rows on top option Noppie Excel Discussion (Misc queries) 2 December 28th 04 03:17 PM


All times are GMT +1. The time now is 09:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"