Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() All, Thanks in advance for any help offered! In the code below, I have a bunch of ranges defined and they all wor great until "rng3" and "rng4". I won;t know where 2 of these range will start, hence the use of "icol and jcol". Set rng = .Range(.Cells(4, 4), _ .Cells(4, 256).End(xlToLeft)) Set rng2A = rng.Find(What:="Code", After:=rng(1), _ LookIn:=xlValues, _ LookAt:=xlPart, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlNext, _ MatchCase:=True) icol = rng2A.Column Set rng1 = .Range(.Cells(6, 3), _ .Cells(Rows.Count, 3).End(xlUp)) Set rng2 = .Range(.Cells(6, icol), _ .Cells(Rows.Count, icol).End(xlUp)) Set rng3A = rng.Find(What:="Detailed Description", After:=rng(1), _ LookIn:=xlValues, _ LookAt:=xlPart, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlNext, _ MatchCase:=True) jcol = rng3A.Column Set rng3 = .Range(.Cells(cell.Row, 4), .Cells(cell.Row, (jcol - 1))) Set rng4 = .Range(.Cells(cellA.Row, (cellA.Column + 1)) .Cells(cellA.Row, Cells(Columns.Count).End(xlToLeft))) End With In rng3 I am trying to say "start at column 4 on the current cell ro and extend right to 1 before my unknown column". In rng4 I am trying to say "start one column to the right of th current cell and on the same row, extend right as many column as ar used". I am sure I have something completely backwards. Can anyone straighte me out? Thanks -- Cel ----------------------------------------------------------------------- Celt's Profile: http://www.excelforum.com/member.php...fo&userid=1941 View this thread: http://www.excelforum.com/showthread.php?threadid=52933 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sustaining Range Definitions in a Function | Excel Discussion (Misc queries) | |||
Definitions | Excel Discussion (Misc queries) | |||
Need Workbook and Worksheet definitions | Excel Discussion (Misc queries) | |||
Function Definitions | Excel Programming | |||
Operator definitions | Excel Programming |