ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting 10 cells downwards (https://www.excelbanter.com/excel-programming/372256-selecting-10-cells-downwards.html)

[email protected]

Selecting 10 cells downwards
 
Hi,

I'm pretty sure that this is an easy topic but I have been looking all
over for a way to do this and cannot find it.

I am copying data from one spreadsheet to another and I asking the
Macro to find a certain title in the first spreadsheet and then select
and copy the following 10 cells down.

I currently have in:

Range(Selection, Selection.End(xlDown)).Select

but the problem is that there is a blank row in the range I'm trying to
copy and therefore each time I run this command it only goes down by
two cells instead of ten. And I'm unable to select a cell reference ie
("A1:A10").select as the infomation could be in different cells each
time I run the code.

Any advice would be much appreciated.

Thanks


FSt1

Selecting 10 cells downwards
 
hi,
try something like this...
Range(Selection, Selection.offset(10,0)).Select

lookup the offset property in vb help for more info.

regards
FSt1

" wrote:

Hi,

I'm pretty sure that this is an easy topic but I have been looking all
over for a way to do this and cannot find it.

I am copying data from one spreadsheet to another and I asking the
Macro to find a certain title in the first spreadsheet and then select
and copy the following 10 cells down.

I currently have in:

Range(Selection, Selection.End(xlDown)).Select

but the problem is that there is a blank row in the range I'm trying to
copy and therefore each time I run this command it only goes down by
two cells instead of ten. And I'm unable to select a cell reference ie
("A1:A10").select as the infomation could be in different cells each
time I run the code.

Any advice would be much appreciated.

Thanks



Jim May

Selecting 10 cells downwards
 
How 'bout:

Sub Macro1()
' Macro1 Macro
' Macro recorded 9/6/2006 by Jim May
'
ActiveCell.Range("A1:A10").Select
End Sub

Jim


" wrote in message
ups.com:

Hi,

I'm pretty sure that this is an easy topic but I have been looking all
over for a way to do this and cannot find it.

I am copying data from one spreadsheet to another and I asking the
Macro to find a certain title in the first spreadsheet and then select
and copy the following 10 cells down.

I currently have in:

Range(Selection, Selection.End(xlDown)).Select

but the problem is that there is a blank row in the range I'm trying to
copy and therefore each time I run this command it only goes down by
two cells instead of ten. And I'm unable to select a cell reference ie
("A1:A10").select as the infomation could be in different cells each
time I run the code.

Any advice would be much appreciated.

Thanks




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

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