ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with leap-frogging myCell Range (https://www.excelbanter.com/excel-programming/379211-problem-leap-frogging-mycell-range.html)

Dennis

Problem with leap-frogging myCell Range
 
2003

Here is what I am trying to do the (code below is not all
of the code - just enough for explanation):

For Each myCell in myRange

Sheets("Constants Input").Autofilter
If Sheets("Constants Input").AutoFilterMode = True Then
Sheets("Constants Input").UsedRange.AutoFilter
End If
FilterCriteria = 33
With Sheets("Constants Input").Range("A1:F" & Cells(Rows.Count, _
"B").End(xlUp).Row)
.AutoFilter Field:=2, Criteria1:="<"
.AutoFilter Field:=4, Criteria1:="=" & FilterCriteria
End With

myCell.Offset(0, 3).Formula = Sheets("Constants Input").Range("E2:E" _
& Cells(Rows.Count, "E").End(xlUp).Row).SpecialCells(xlVisible) _
.Cells(2, 5).Formula

'First time through the loop ... Cells(2, 5) returns the formula in
'"E2" which is fine. But each succeeding myCell the address is "I2"
'

Next Mycell

I am now Too Close to the Problem to see something really obvious.

What I need is for every formula in Range("E2:E" &
VisibleCells.Rows.count) to have exactly the same formula as in the
first visible cell in Column "E" after the FilterCriteria is changed
for each myCell "D2:Dxxxxx"


TIA EagleOne



All times are GMT +1. The time now is 08:00 PM.

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