Hello
I have a piece of code which works well for its intended purpose and has part where certain worksheet names are specified which are to be excluded for the list that is made by using that code. (See the sample below)
In the above code, "Reports", "Trial List", "Original Template" are the three worksheets that will be excluded from the displayed list. I have created a table ("Table2") and am adding the names of worksheets to be excluded in that table in the column named "Ignore_L", as its much easier for me to add 3-4 more names in the table than to add in those sheetnames in the code directly every time. Purpose of inserting table was that the range automatically extends everytime a new name is added to the list. I have defined a name for this column in the table as "Ignore_List".
I have tried referencing the Defined Name "Ignore_List" in my code with no luck. It either gives an error or doesn't work.
Would appreciate any help from the group !
Cheers
I have a piece of code which works well for its intended purpose and has part where certain worksheet names are specified which are to be excluded for the list that is made by using that code. (See the sample below)
VBA Code:
Dim xSheet As Worksheet
Dim xRow As Integer
Dim calcState As Long
Dim scrUpdateState As Long
For Each xSheet In Application.Worksheets
If IsError(Application.Match(xSheet.Name, _
Array(Me.Name, "Reports", "Trial List", "Original Template"), 0)) Then
xRow = xRow + 1
In the above code, "Reports", "Trial List", "Original Template" are the three worksheets that will be excluded from the displayed list. I have created a table ("Table2") and am adding the names of worksheets to be excluded in that table in the column named "Ignore_L", as its much easier for me to add 3-4 more names in the table than to add in those sheetnames in the code directly every time. Purpose of inserting table was that the range automatically extends everytime a new name is added to the list. I have defined a name for this column in the table as "Ignore_List".
I have tried referencing the Defined Name "Ignore_List" in my code with no luck. It either gives an error or doesn't work.
Would appreciate any help from the group !
Cheers
Last edited by a moderator: