![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: OKC
Posts: 98
|
I can delete all of the named cells with the below code, but i want to delete the named cells of a selected range that I choose only. Please help.
sub deleteallnames () dim nm as name for each nm in names nm.delete next end sub |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Eddy
Try this Sub deleteallnames() Dim nm As Name On Error Resume Next For Each nm In Names If Not Intersect(Range(nm.Name), Selection) _ Is Nothing Then nm.Delete Next nm On Error GoTo 0 End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: OKC
Posts: 98
|
works great....thanks!!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|