Problem with leap-frogging myCell Range

D

Dennis

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top