Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Select specic no. of rows down

Hi
is there quick vba code to select specific no. of entire row down?

sub select_row_down(byval intRow as long)

???selection.entirerow.select???
???????

end sub

thanks

Leung
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select specic no. of rows down

Hi Leung,

Perhaps something like:

'=====================
Public Sub Tester1()
Dim Rng As Range
Const NumOfRows = 10 '<<====== CHANGE

Set Rng = ActiveCell.EntireRow.Resize(NumOfRows)

End Sub

'<<=====================

BTW, it is rarely necessary, or desirable, to make selections. In the above
example, manipulation can be effected on the Rng object variable without any
selection. E.g.:

Rng.Interior.ColorIndex = 36


---
Regards,
Norman



"Leung" wrote in message
...
Hi
is there quick vba code to select specific no. of entire row down?

sub select_row_down(byval intRow as long)

???selection.entirerow.select???
???????

end sub

thanks

Leung



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select specic no. of rows down

Hi Leung,

Const NumOfRows = 10 '<<====== CHANGE


should read:

Const NumOfRows As Long = 10 '<<====== CHANGE

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Leung,

Perhaps something like:

'=====================
Public Sub Tester1()
Dim Rng As Range
Const NumOfRows = 10 '<<====== CHANGE

Set Rng = ActiveCell.EntireRow.Resize(NumOfRows)

End Sub

'<<=====================

BTW, it is rarely necessary, or desirable, to make selections. In the
above example, manipulation can be effected on the Rng object variable
without any selection. E.g.:

Rng.Interior.ColorIndex = 36


---
Regards,
Norman



"Leung" wrote in message
...
Hi
is there quick vba code to select specific no. of entire row down?

sub select_row_down(byval intRow as long)

???selection.entirerow.select???
???????

end sub

thanks

Leung





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Select specic no. of rows down

can we not use
range("a1").offset(5,0)
it will godown 5 rows.from A1
have I understood your question.

"Leung" wrote in message
...
Hi
is there quick vba code to select specific no. of entire row down?

sub select_row_down(byval intRow as long)

???selection.entirerow.select???
???????

end sub

thanks

Leung



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
Cannot select rows in VBA [email protected] Excel Discussion (Misc queries) 1 September 6th 07 04:00 AM
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
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 12:10 PM.

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

About Us

"It's about Microsoft Excel"