ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range objects (?) (https://www.excelbanter.com/excel-programming/286115-range-objects.html)

Bill[_19_]

Range objects (?)
 
Hello,
I have been having trouble defining a range of cells
when using objects. (If I am right, the counting cell is
my object) I have tried different approaches, but the
code below shows my latest failed attempt. How do you
specify a range of cells when you are using an object?
Here is my code:

Dim numberrow as long
Dim countingcell as object
numberrow = 5
Set countingcell = range("n4")
For cellcount = 0 to numberrow
If countingcell.offset(cellcount,0) = True Then
Worksheets("Sheets2").Range(Cells(cellcount,-3), Cells
(cellcount, -13)).select
etc....
Thanks
Bill

Tom Ogilvy

Range objects (?)
 
Dim numberrow as long
Dim countingcell as Range
Dim cellcount as Long
numberrow = 5
Set countingcell = range("n4")
For cellcount = 0 to numberrow
If countingcell.offset(cellcount,0) = True Then
countingCell.Offset(cellCount,-13).Resize(1,10).Select
msgbox "Take a look, click to continue . . . "
End if

--
Regards,
Tom Ogilvy


"Bill" wrote in message
...
Hello,
I have been having trouble defining a range of cells
when using objects. (If I am right, the counting cell is
my object) I have tried different approaches, but the
code below shows my latest failed attempt. How do you
specify a range of cells when you are using an object?
Here is my code:

Dim numberrow as long
Dim countingcell as object
numberrow = 5
Set countingcell = range("n4")
For cellcount = 0 to numberrow
If countingcell.offset(cellcount,0) = True Then
Worksheets("Sheets2").Range(Cells(cellcount,-3), Cells
(cellcount, -13)).select
etc....
Thanks
Bill





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

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