Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I need to be able to clear the content of all the named cells that start with "tSel_" - I've created the little function below (I'am a VBA newbie) and I was able to develop the function below - This works great, BUT for one thing: If the Named Cell refers to MERGED cells, this fails with a "Cannot change part of a merged cell." error... Any suggestions how I can fix this ? THANKS!! Richard Public Function ClearCells() Dim strFirstletter As String Set nms = ActiveWorkbook.Names For i = 1 To nms.Count strFirstletter = Left(nms(i).Name, 5) If strFirstletter = "tSel_" Then nms(i).RefersToRange.ClearContents End If Next End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change cell background color as part of the If statement? | Excel Worksheet Functions | |||
Macro to change part of cell | Excel Discussion (Misc queries) | |||
Why only part of the text is merged from excel cell into word? | Excel Discussion (Misc queries) | |||
Keeping one part of a formula same, but change other cell ref? | Excel Discussion (Misc queries) | |||
Find and clearcontent | Excel Programming |