Seeking method to extract from cell contents (partial)

auto.pilot

Well-known Member
Joined
Sep 27, 2007
Messages
734
Office Version
  1. 365
Platform
  1. Windows
I am working with several hundred rows of data that look much like what is shown below.


=IF(B8>=DATEVALUE("06/30/2006"),Calc(A714A_C5,A705A_C5+A705B_C5+A704D_C5)*100,IF(B8>=DATEVALUE("03/31/2004"),Calc(A772_C5+A773_C5+A774_C5,A705A_C5+A705B_C5+A704D_C5)*100,"N/A"))
=IF(B8<DATEVALUE("6/30/2006"),IF((A706_C5+A708B_C5)=0,0,((A756_C5+A757_C5+A758_C5)/(A706_C5+A708B_C5))*100), IF((A706_C5+A708B_C5)=0,0,((A715A_C5)/(A706_C5+A708B_C5))*100))


I need to extract every instance where the named ranges start with 'A' and end with 'C5'. I considered listing all the names in the name manager and using them, but there are nearly 7,000 named ranges. I need only a few hundred that are used in formulas like shown above. How can I extract the names that are included in a range of formulas? They all all start with 'A' and end with 'C5'? Ideally, I simply need to list them all in a single column.

Thanks in advance.
 
Last edited by a moderator:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I continued my search after posting this thread and found this, which was posted in 2017:

VBA Code:
Sub UniqueListOfWordsWithUnderscore()
  Dim X As Long, Cell As Range, Txt As String, Data As Variant
  Application.ScreenUpdating = False
  On Error GoTo Whoops
  For Each Cell In Range("A2", Cells(Rows.Count, "A").End(xlUp))
    Txt = LCase(Cell.Value)
    For X = 1 To Len(Txt)
      If Mid(Txt, X, 1) Like "[!A-Za-z0-9_]" Then Mid(Txt, X) = " "
    Next
    Data = Filter(Split(Application.Trim(Txt)), "_")
    With CreateObject("Scripting.Dictionary")
      For X = 0 To UBound(Data)
        .Item(Data(X)) = 1
      Next
      Cell.Offset(, 1).Value = Join(.Keys, "; ")
    End With
  Next
Whoops:
  Application.ScreenUpdating = True
End Sub

It works! based on the fact that all of my named ranges that I am seeking to extract also have an underscore in them.

Thanks!

Jim
 
Upvote 0
Solution

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top