Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using this code to delineate the range I want filters applied to:
Range(Range("b3"), Range("b3").End(xlDown).End(xlToRight) _ .Offset(-1, 2)).Select Now I want a macro to go into every worksheet in the workbook, the number may vary, and create a named range called FilterRange with the worksheet's name. Than I can use that named range to apply filters to from buttons/macros. Can anyone help me here? Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would Dim wks As Worksheet and Dim strName As String, then
For Each wks In WhateverWorkbook strName = wks.Name strName = strName & "FilterRange" ' set range, using strName as the name Next wks HTH Ed "davegb" wrote in message oups.com... I'm using this code to delineate the range I want filters applied to: Range(Range("b3"), Range("b3").End(xlDown).End(xlToRight) _ .Offset(-1, 2)).Select Now I want a macro to go into every worksheet in the workbook, the number may vary, and create a named range called FilterRange with the worksheet's name. Than I can use that named range to apply filters to from buttons/macros. Can anyone help me here? Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets With sh .Range(.Range("B3"), .Range("B3").End(xlDown).End(xlToRight) _ .Offset(-1, 2)).Name = "'" & sh.Name & "'!FilterRange" End With Next sh -- HTH RP (remove nothere from the email address if mailing direct) "davegb" wrote in message oups.com... I'm using this code to delineate the range I want filters applied to: Range(Range("b3"), Range("b3").End(xlDown).End(xlToRight) _ .Offset(-1, 2)).Select Now I want a macro to go into every worksheet in the workbook, the number may vary, and create a named range called FilterRange with the worksheet's name. Than I can use that named range to apply filters to from buttons/macros. Can anyone help me here? Thanks in advance. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob and Ed! Got it working.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named Range From One Workbook Used in Validation Drop Down in 2nd Workbook | Excel Discussion (Misc queries) | |||
How to create a dynamic named range? | Excel Discussion (Misc queries) | |||
Create a Named Range in Excel with VBA | Excel Programming | |||
List named range per sheet in workbook | Excel Programming | |||
Create named range | Excel Programming |