ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding rows (https://www.excelbanter.com/excel-programming/431273-adding-rows.html)

Squeaky

Adding rows
 
This should be easy but is giving me grief.
I need code that, after selecting a random cell in column A ( I have the
code to do that part) will then select the next 12 entire rows underneath it.

Squeaky

Don Guillett

Adding rows
 
As ALWAYS, post your code for comments
activecell.resize(12).select

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Squeaky" wrote in message
...
This should be easy but is giving me grief.
I need code that, after selecting a random cell in column A ( I have the
code to do that part) will then select the next 12 entire rows underneath
it.

Squeaky



Jacob Skaria

Adding rows
 
If you mean *** entire *** row...from the active cell; try the below

Rows(activecell.row & ":" & activecell.row+12).select

If this post helps click Yes
---------------
Jacob Skaria


"Squeaky" wrote:

This should be easy but is giving me grief.
I need code that, after selecting a random cell in column A ( I have the
code to do that part) will then select the next 12 entire rows underneath it.

Squeaky


Rick Rothstein

Adding rows
 
The wording of your request is not entirely clear to me. When you say "then
select 12 entire rows **underneath** it"... to you mean the 12 row below the
active cell? If so...

ActiveCell.EntireRow.Resize(12).Offset(1).Select

If, on the other hand, you are requesting 12 entire rows *starting with* the
active cell, then do this instead...

ActiveCell.EntireRow.Resize(12).Select

--
Rick (MVP - Excel)


"Squeaky" wrote in message
...
This should be easy but is giving me grief.
I need code that, after selecting a random cell in column A ( I have the
code to do that part) will then select the next 12 entire rows underneath
it.

Squeaky



Don Guillett

Adding rows
 

Sub selectrng()
ActiveCell.Resize(12).EntireRow.Select
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
As ALWAYS, post your code for comments
activecell.resize(12).select

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Squeaky" wrote in message
...
This should be easy but is giving me grief.
I need code that, after selecting a random cell in column A ( I have the
code to do that part) will then select the next 12 entire rows underneath
it.

Squeaky




Squeaky

Adding rows
 
Thanks for all of the suggestions.

The one from Rick did the trick.

Squeaky

"Squeaky" wrote:

This should be easy but is giving me grief.
I need code that, after selecting a random cell in column A ( I have the
code to do that part) will then select the next 12 entire rows underneath it.

Squeaky



All times are GMT +1. The time now is 02:17 PM.

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