• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Comobox depending on another Combobox

Svmaxcel

Member
Someone in the forum, helped me creating named ranges from pivot table, and then link it with comobox but I have some more issue

Rebriefing some more issues
Issue # 1 Post no 2 VBA gives an error as it tried to go beyond last Row of excel(A1048576), it creates name ranges, but gives an error.

Issue # 2 It creates Name Ranges, but overlaps the old Named ranges.
so it keeps the old name as well as new names (i guess it would be better to delete old name ranges in column A)

Issue # 3 While we are using full name with a space in between, excel adds an Underscore to replace the space, due to which they are not recognized and gives error while using VBA, I guess we can use INDIRECT, but no clue of how to use it

Attaching updated file
 

Attachments

  • Book1 (Hui).xlsm
    30.3 KB · Views: 2
Code:
Sub Delete_Names()

Dim MyNames As String

Range("F3").Select

Do Until IsEmpty(ActiveCell)
    MyNames = Replace(ActiveCell, " ", "_")
    ActiveWorkbook.Names(MyNames).Delete
    Selection.End(xlDown).Select
    Selection.End(xlDown).Select
Loop
Range("A1").Select

End Sub
 
Back
Top