ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Selection Macro (https://www.excelbanter.com/excel-programming/313023-simple-selection-macro.html)

Jason

Simple Selection Macro
 
I'm a beginner, and need some code that will do the following. Suppose I
have cell C10 selected. I want the macro to look at the current selection,
and then highlight the entire rows from the current selection down to the
last row (meaning 65,000+). Thanks

sebastienm

Simple Selection Macro
 
Hi,
something like:

Sub SelectAllRowsBellow()
If Selection Is Nothing then Exit Sub
If TypeName(Selection)<"Range" Then Exit Sub
Range(Selection,Range("A65536")).EntireRow.Select
End Sub

Regards,
Sebastien

"Jason" wrote:

I'm a beginner, and need some code that will do the following. Suppose I
have cell C10 selected. I want the macro to look at the current selection,
and then highlight the entire rows from the current selection down to the
last row (meaning 65,000+). Thanks


Don Guillett[_4_]

Simple Selection Macro
 
Why would you want to do this?

Sub selectall()
Range(Cells(ActiveCell.Row, "a"), Cells(65536, "a")).EntireRow.Select
End Sub


--
Don Guillett
SalesAid Software

"Jason" wrote in message
...
I'm a beginner, and need some code that will do the following. Suppose I
have cell C10 selected. I want the macro to look at the current

selection,
and then highlight the entire rows from the current selection down to the
last row (meaning 65,000+). Thanks




Bob Phillips[_6_]

Simple Selection Macro
 
Another way just for fun

activecell.resize(rows.count-activecell.row+1,1).entirerow.select

You can also do it with Ctrl-Shift-Down-Arrow then Right-Arrow.

But as Don said, why?

--

HTH

RP

"Don Guillett" wrote in message
...
Why would you want to do this?

Sub selectall()
Range(Cells(ActiveCell.Row, "a"), Cells(65536, "a")).EntireRow.Select
End Sub


--
Don Guillett
SalesAid Software

"Jason" wrote in message
...
I'm a beginner, and need some code that will do the following. Suppose

I
have cell C10 selected. I want the macro to look at the current

selection,
and then highlight the entire rows from the current selection down to

the
last row (meaning 65,000+). Thanks







All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com