Trying to develop a "simple" code which deletes all of the Range Names in a Workbook without deleting the Print_Area\Print_Titles -
For example - in a workbook - I have the following ranges
Name: Refers to:
ABC =Sheet1!$F$21:$F$22
Sheet1!Print_Area =Sheet1!$C$1:$EG$91
Sheet1!Print_Titles =Sheet1!$A:$B,Sheet1!$1:$10
Here's what I've been able to pull together so far - It's a modification of
code from the The Excel Logic Page email: AaronBlood@ hotmail.com
Sub Play()
'Delete all ranges
For Each WBname In ActiveWorkbook.Names
If Not WBname Like "*" & "!Print_Area" And _
Not WBname Like "*" & "!!Print_Titles" Then
WBname.Delete
End If
Next
End Sub
The problem is it's reading the Refers to: data - not the Name Data - so it deletes every thing - I've tried all sorts of ways (1600 VBA CD, Walkenback's 2002 Power progragming, etc...) - Just doesn't seem to want to work
For example - in a workbook - I have the following ranges
Name: Refers to:
ABC =Sheet1!$F$21:$F$22
Sheet1!Print_Area =Sheet1!$C$1:$EG$91
Sheet1!Print_Titles =Sheet1!$A:$B,Sheet1!$1:$10
Here's what I've been able to pull together so far - It's a modification of
code from the The Excel Logic Page email: AaronBlood@ hotmail.com
Sub Play()
'Delete all ranges
For Each WBname In ActiveWorkbook.Names
If Not WBname Like "*" & "!Print_Area" And _
Not WBname Like "*" & "!!Print_Titles" Then
WBname.Delete
End If
Next
End Sub
The problem is it's reading the Refers to: data - not the Name Data - so it deletes every thing - I've tried all sorts of ways (1600 VBA CD, Walkenback's 2002 Power progragming, etc...) - Just doesn't seem to want to work