peacenik
11-01-2006, 05:54 PM
I do a lot of work with filters and would like to run macros where I highlight something I have filtered and run a "for each" loop against each cell in the highlighted area. This works well except that when some rows are hidden by the filter and they are included in the range, then the macro is applied to them as well. Does anyone have any ideas about how I can test for this. Here is a sample code that I use.
Sub calcrange()
TargetRange = Selection.Address
For Each cell In Range(TargetRange)
cell.Calculate
Next
End Sub
Sub calcrange()
TargetRange = Selection.Address
For Each cell In Range(TargetRange)
cell.Calculate
Next
End Sub