![]() |
Too Many Line continuations
I am trying to create a macro to filter about 160 brand names of 300, i
started recording a macro and then using filter, i checked all the brand names i wanted, the problem is that when i finished i got the error msg " Too Many Line Continuations" what can i do to create a macro to filter only those 160 or so brands? Thanks |
Answer: Too Many Line continuations
The "Too Many Line Continuations" error message usually occurs when there are too many line breaks in your code. This can happen when you have a long list of items that you are trying to filter.
One way to avoid this error is to use an array to store your list of brand names. Here's an example of how you can modify your code to use an array:
This code will filter the data based on each brand name in the array, one at a time. Alternatively, you can also try breaking up your code into smaller chunks by using variables to store parts of your filter criteria. This can help reduce the number of line continuations in your code. For example: Formula:
|
Too Many Line continuations
Uh... don't use so many line continuations maybe? In case you are not aware
of what that message means... it occurs when you take a long line of text an split it up on multiple lines using a space followed by an underline to keep the links linked together. For example... SomeTextVariable = "Line one which goes on for awhile and " & _ "then continues on, but one line lower" If I recall correctly, there are a maximum of 25 line continuations that can be used on a single code statement... so just don't break it apart so often... or see if you can split the multiline statement you are trying to construct into more than one statement, each of which can have a maximum of 25 line continuations. -- Rick (MVP - Excel) "Gmata" wrote in message ... I am trying to create a macro to filter about 160 brand names of 300, i started recording a macro and then using filter, i checked all the brand names i wanted, the problem is that when i finished i got the error msg " Too Many Line Continuations" what can i do to create a macro to filter only those 160 or so brands? Thanks |
Too Many Line continuations
.... or better still, put the 160 into a worksheet table and compare against
that. -- __________________________________ HTH Bob "Rick Rothstein" wrote in message ... Uh... don't use so many line continuations maybe? In case you are not aware of what that message means... it occurs when you take a long line of text an split it up on multiple lines using a space followed by an underline to keep the links linked together. For example... SomeTextVariable = "Line one which goes on for awhile and " & _ "then continues on, but one line lower" If I recall correctly, there are a maximum of 25 line continuations that can be used on a single code statement... so just don't break it apart so often... or see if you can split the multiline statement you are trying to construct into more than one statement, each of which can have a maximum of 25 line continuations. -- Rick (MVP - Excel) "Gmata" wrote in message ... I am trying to create a macro to filter about 160 brand names of 300, i started recording a macro and then using filter, i checked all the brand names i wanted, the problem is that when i finished i got the error msg " Too Many Line Continuations" what can i do to create a macro to filter only those 160 or so brands? Thanks |
All times are GMT +1. The time now is 05:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com