ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a Range Of Cells. (https://www.excelbanter.com/excel-programming/323919-selecting-range-cells.html)

Neil

Selecting a Range Of Cells.
 
Can I select a range of cells programatically without knowing exactly which
ones they are?

I have a sheet that has a variable number of rows and columns, my code
searches all cells for a certain condition, and when the condition is met, it
needs to select that cell, and the next 8 cells in the same row in order to
copy and paste them somewhere else.

I've tried to use the line: (and various derivatives)

Selection.Offset(0, 8).Select

But this doesn't work.

Can anyone tell me what I'm doing wrong?

Thanks

Neil

Bob Phillips[_6_]

Selecting a Range Of Cells.
 
Try

Selection.Resize(1,8).Select

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Neil" wrote in message
...
Can I select a range of cells programatically without knowing exactly

which
ones they are?

I have a sheet that has a variable number of rows and columns, my code
searches all cells for a certain condition, and when the condition is met,

it
needs to select that cell, and the next 8 cells in the same row in order

to
copy and paste them somewhere else.

I've tried to use the line: (and various derivatives)

Selection.Offset(0, 8).Select

But this doesn't work.

Can anyone tell me what I'm doing wrong?

Thanks

Neil





All times are GMT +1. The time now is 05:14 AM.

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