Quantcast
Channel: Microsoft Community - Super Fresh
Viewing all articles
Browse latest Browse all 1237235

Clear text only of a named cell

$
0
0

Hi

I want to clear the text of a named cell, I have found the below works but clears the entire cell

including all formatting. The named cell is called delete. Thanks any help would be appreciated.

SubClear_ActiveSheet_Name_Ranges()

    DimxName AsName
    DimxInput AsString
    DimxRg AsRange
    OnError ResumeNext
    xInput = Application.InputBox("delete"
    IfxInput = "False"ThenExitSub
    Application.ScreenUpdating = False
    SetxName = ActiveWorkbook.Names(xInput)
    IfNot xName IsNothingThen
         xName.RefersToRange.Clear
    EndIf
    Application.ScreenUpdating = True
EndSub

Viewing all articles
Browse latest Browse all 1237235

Trending Articles