Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi....
I altered this formula until i almost have what i need except for one thing... Instead of the offset transferring to the 'first available' (0,1) cell five rows over, i need it to copy and transfer to the same row 5 rows over. Sub macro3() Dim ws As Worksheet Dim iA As Integer Dim iB As Integer Dim c As Range Dim rng As Range Set ws = Worksheets("Sheet1") Set rng = ws.Range("A1:A65536") For Each c In rng If c = Range("I1") Then iA = iA + 1 ws.Cells(iA, 5) = c.Offset(0, 1) End If Next c End Sub Thanx |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() As for the range, yes... This is a log sheet that I am going to be using for a while so it is going to get pretty long. Thanx! Word purrrrrrr-fectly! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Still better NOT to use the whole column. Try my idea.
-- Don Guillett Microsoft MVP Excel SalesAid Software "J.W. Aldridge" wrote in message oups.com... As for the range, yes... This is a log sheet that I am going to be using for a while so it is going to get pretty long. Thanx! Word purrrrrrr-fectly! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
THanx...
Found one issue. I think it has to do with the portion of the code that states" iA = iA + 1". Once the match is found, i am copying the cell one row over. The code no longer does that, it just returns the same value of the referenced cell. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A bit more explanation along with sample data
-- Don Guillett Microsoft MVP Excel SalesAid Software "J.W. Aldridge" wrote in message oups.com... THanx... Found one issue. I think it has to do with the portion of the code that states" iA = iA + 1". Once the match is found, i am copying the cell one row over. The code no longer does that, it just returns the same value of the referenced cell. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not clear on what you are asking, but let me give it a shot.
c.Offset(0, 1) refers to the cell that is 0 rows down and one column to the right of the cell in c. Try adding this to your code within the For/Next Loop. Debug.print c.address, c.offset(0,1).address If that's not the problem, let me know. HTH, Barb Reinhardt "J.W. Aldridge" wrote: Hi.... I altered this formula until i almost have what i need except for one thing... Instead of the offset transferring to the 'first available' (0,1) cell five rows over, i need it to copy and transfer to the same row 5 rows over. Sub macro3() Dim ws As Worksheet Dim iA As Integer Dim iB As Integer Dim c As Range Dim rng As Range Set ws = Worksheets("Sheet1") Set rng = ws.Range("A1:A65536") For Each c In rng If c = Range("I1") Then iA = iA + 1 ws.Cells(iA, 5) = c.Offset(0, 1) End If Next c End Sub Thanx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul | Excel Worksheet Functions | |||
Find word then use offset to change value in another cell | Excel Programming | |||
Find, Copy offset to offset on other sheet, Run-time 1004. | Excel Programming | |||
Choosing offset on condition found in combobox change colour of cell?? | Excel Programming | |||
Problem with Range.Cells.Offset and Range.Cells( row + offset, column) | Excel Programming |