View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
davegb davegb is offline
external usenet poster
 
Posts: 573
Default Macro runs on certain worksheets, not on others

No, not empty. There are merged cells with descriptions in rows 1 and 2
and Column A, so the continuous data starts at B3, down and to the
right.

Ron de Bruin wrote:
Hi Dave

If there is a empty cell in the B column the range stop there
Is that what you want ?



--
Regards Ron de Bruin
http://www.rondebruin.nl



"davegb" wrote in message ups.com...
Ron,
I tried a few things, and this seems to work. Can you tell me if you
see anything wrong with it?

Sub MFilterRange()
Dim rFilterRange As Range
Dim Sh As Worksheet

For Each Sh In ActiveWorkbook.Worksheets
If Not Right(Sh.Name, 7) = "Records" Then
With Sh
.Range(.Range("B3"),
.Range("B3").End(xlDown).End(xlToRight) _
.Offset(-1, 2)).Name = "'" & Sh.Name & "'!FilterRange"
End With

End If
Next Sh

End Sub

Thanks for the help!