thetrungkien
Thành viên mới

- Tham gia
- 19/12/07
- Bài viết
- 41
- Được thích
- 14
[h=2]Giúp xóa name range[/h]
Mình xin thỉnh giáo các Bạn, mình có 1 file Exell Có quá nhiều namerange mình dung VBA để xóa nhưng không được, nếu xóa bằng thủ công thì được mong các bạn giúp (dùng VBA nha)
code minh dung nè mà sao xóa không được
Sub Remove_Hidden_Names()
' Dimension variables.
Dim xName As Variant ' Loop once for each name in the workbook.
For Each xName In ActiveWorkbook.Names
If xName.Visible = True Then
xName.Delete
Else 'MsgBox (xName) 'xName.Delete
ActiveCell.Value = xName
End If ActiveCell.Offset(1, 0).Select
Next xName
End Sub
code minh dung nè mà sao xóa không được
Sub Remove_Hidden_Names()
' Dimension variables.
Dim xName As Variant ' Loop once for each name in the workbook.
For Each xName In ActiveWorkbook.Names
If xName.Visible = True Then
xName.Delete
Else 'MsgBox (xName) 'xName.Delete
ActiveCell.Value = xName
End If ActiveCell.Offset(1, 0).Select
Next xName
End Sub