Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've been running a series of macros without problems for months. When
I made some major modifications to another macro in the same project, all these macros stopped working, even though the macro I was modifying and these macros don't call or relate to each other. The only connection is that they use the same range and varable name for that range. Sub Top10() ActiveSheet.Range("rFltrRng").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("Z1:Z2"), Unique:=False Range("a1").Select End Sub I've tried using a different name for "rFltrRng" to separate it from the other variable in the other macro. Any ideas? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
rFltrRng isn't a variable. It is a string constant. Used in the context
you present, it represents the name of a range in Insert=Name=Define. You need to go to Insert=Name=Define and see what the current refers to Range definition is. If it isn't what you expect, then you need to figure out how it is getting changed. -- Regards, Tom Ogilvy "davegb" wrote in message oups.com... I've been running a series of macros without problems for months. When I made some major modifications to another macro in the same project, all these macros stopped working, even though the macro I was modifying and these macros don't call or relate to each other. The only connection is that they use the same range and varable name for that range. Sub Top10() ActiveSheet.Range("rFltrRng").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("Z1:Z2"), Unique:=False Range("a1").Select End Sub I've tried using a different name for "rFltrRng" to separate it from the other variable in the other macro. Any ideas? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you have "Option Explicit" at the top of your macro modules?
This forces Excel to alert you when there are certain problems with your code: variables that are not recognized; variables not defined correctly, etc. Please supply more info on the nature of the any errors that come up. Type, line of code(s) that fails, etc... -- steveB Remove "AYN" from email to respond "davegb" wrote in message oups.com... I've been running a series of macros without problems for months. When I made some major modifications to another macro in the same project, all these macros stopped working, even though the macro I was modifying and these macros don't call or relate to each other. The only connection is that they use the same range and varable name for that range. Sub Top10() ActiveSheet.Range("rFltrRng").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("Z1:Z2"), Unique:=False Range("a1").Select End Sub I've tried using a different name for "rFltrRng" to separate it from the other variable in the other macro. Any ideas? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks, Tom, that helped me track down the problem. Tom Ogilvy wrote: rFltrRng isn't a variable. It is a string constant. Used in the context you present, it represents the name of a range in Insert=Name=Define. You need to go to Insert=Name=Define and see what the current refers to Range definition is. If it isn't what you expect, then you need to figure out how it is getting changed. -- Regards, Tom Ogilvy "davegb" wrote in message oups.com... I've been running a series of macros without problems for months. When I made some major modifications to another macro in the same project, all these macros stopped working, even though the macro I was modifying and these macros don't call or relate to each other. The only connection is that they use the same range and varable name for that range. Sub Top10() ActiveSheet.Range("rFltrRng").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("Z1:Z2"), Unique:=False Range("a1").Select End Sub I've tried using a different name for "rFltrRng" to separate it from the other variable in the other macro. Any ideas? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() STEVE BELL wrote: Do you have "Option Explicit" at the top of your macro modules? Yes This forces Excel to alert you when there are certain problems with your code: variables that are not recognized; variables not defined correctly, etc. Please supply more info on the nature of the any errors that come up. Type, line of code(s) that fails, etc... Thanks for the help, Steve! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro breaks my links. | Excel Discussion (Misc queries) | |||
Programming (macro) breaks due to translation | Excel Discussion (Misc queries) | |||
blank row macro with page breaks | Excel Programming | |||
blank row macro with page breaks | Excel Programming | |||
blank row macro with page breaks | Excel Programming |