Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that is called each time a different sheet in the
workbook is selected. The macro is supposed to define the determined range as a named ramge, "FilterRange". Sub CtyShtFltRng() Dim lCol as Long Dim lRow As Long Dim wActSheet As Worksheet Set wActSheet = ActiveSheet Set rStart = Range("B3") lRow = rStart.End(xlDown).Row - 1 lCol = rStart.End(xlToRight).Column Set rCtyShtFltRng = Range(rStart, Cells(lRow, lCol)) Set wActSheet.Names("FilterRange") = rCtyShtFltRng <---ERROR wActSheet.Range("FilterRange").Select End Sub I'm getting an "wrong number of arguments or invlalid property assignment" at the marked line. I've tried about 10 or 12 variations on this line, but none worked. Can someone tell me how to make this work? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Show (and Print) Only Named Range? | Excel Discussion (Misc queries) | |||
Named Range Macro | Excel Discussion (Misc queries) | |||
Insert Named Range using Excel Macro | Excel Programming | |||
How do I get a macro to ask for a 'range' to go to with a choice of Named ranges? | Excel Programming | |||
Problem with named range as VBA macro parameter | Excel Programming |