> On 28 Jan., 17:03, Smallweed <Smallw...@discussions.microsoft.com>
> wrote:
[quoted text clipped - 22 lines]
> What if I want the search to begin at a certain row? I know how to
> find the row number, but how do I use it in the range?
If x is the row to start in, the following amendment looks at every cell in
the range between Dx (e.g. D5 if x=5) and D999 (Cells(x,y) is row x, column
y).
For Each rng2 In Worksheets("Sheet2").Range(Cells(x, 4), Cells(999, 4).Cells
> 2)
> The advanced and perfect solution would be to offset the sheet1 value
> to another column
> I can make the value returned from sheet 2 (column E) to be the number
> of columns that the value should be offset - is there a way of making
> this happen?
I returned the values to Sheet3, offset down a cell each time so you get a
column of results. Offset(row, col) is useful. E.g., instead of:
Worksheets("Sheet3").Cells(lngCtr,1).Value=rng2.Offset(0,1).Value in the
above you could do:
rng1.Offset(0, rng2.Value).Value=whatever
> Thanks !!!
HH - 29 Jan 2008 13:47 GMT
> If x is the row to start in, the following amendment looks at every cell in
> the range between Dx (e.g. D5 if x=5) and D999 (Cells(x,y) is row x, column
[quoted text clipped - 16 lines]
>
> > Thanks !!!
Seems to be working - wishes my original example had been closer to my
tasks... :-)
If I have hidden columns - do they count when using offset?
e.g. Offset from A to C when B is hidden.
Thanks...
Smallweed - 29 Jan 2008 17:05 GMT
yes they do (there's a range property "visible" you could use to adapt your
code)
> > If x is the row to start in, the following amendment looks at every cell in
> > the range between Dx (e.g. D5 if x=5) and D999 (Cells(x,y) is row x, column
[quoted text clipped - 24 lines]
>
> Thanks...