+ Reply to Thread
Results 1 to 6 of 6

Need Help Finding Text in a "rectangle boxes"

  1. #1
    Registered User
    Join Date
    05-02-2016
    Location
    Angola
    MS-Off Ver
    Microsot Office 2010
    Posts
    3

    Need Help Finding Text in a "rectangle boxes"

    Dear All,
    Need your help, if possible please. I am a new user using VBA.

    I have large ammounts of text stored in “rectangle” boxes across my spreadsheets, as I have copied and pasted flowcharts created in another application. I am trying to use (Ctrl+F) to find text in the flowchart, however I noticed that the normal Find option doesn't work. Is there any way to perform such a search? I also tried to use the VBA code below and it could not work out as well? Any help on this is much appreciated.

    Sub Findtext()
    'Updateby20140603
    Dim xWs As Worksheet
    Dim shp As Shape
    Dim xFindStr As String
    Dim xReplace As String
    xFindStr = Application.InputBox("Find:", xTitleId, "", Type:=2)
    xReplace = Application.InputBox("Replace:", xTitleId, "", Type:=2)
    Set xWs = Application.ActiveSheet
    On Error Resume Next
    For Each shp In xWs.Shapes
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
    Next
    End Sub

  2. #2
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Need Help Finding Text in a "rectangle boxes"

    could you provide an example worksheet so that we can see what type your rectangle boxes are exactly?

  3. #3
    Registered User
    Join Date
    05-02-2016
    Location
    Angola
    MS-Off Ver
    Microsot Office 2010
    Posts
    3

    Re: Need Help Finding Text in a "rectangle boxes"

    Hello LordLoki,
    thanks for trying to assist me on this issue. Attached please find an example of the flowcharts, i am trying to find text in the rectangular boxes.I struggled a bit to get the file attached. Hopefully, I managed to get it through:) . Thanks again for your support.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Need Help Finding Text in a "rectangle boxes"

    Shapes react differently when grouped
    i replaced your inputbox in this case just because ...well it was getting tired of using the inputbox
    put it back in for your final code if you wish

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Registered User
    Join Date
    05-02-2016
    Location
    Angola
    MS-Off Ver
    Microsot Office 2010
    Posts
    3

    Re: Need Help Finding Text in a "rectangle boxes"

    Thank you very much for your support indeed. I see this as a very helpful material. Just one thing, may I ask you what if, I only wanted to find the “names of people” instead of “positions”? Please refer to the boxes shaded in green for your reference. To make it shorter, I would not need to make the use of the REPLACE function. Please accept my apologies in advance if I am asking too much.

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Need Help Finding Text in a "rectangle boxes"

    your current setup does not lend itself to doing this

    normally you could just specify what shape to look at by by the the name of the shape but currently you just have it as Rectangle 114, Rectangle 115...etc
    so there is no where to distinguish one shape from the next

    if you want to enable this, rename all the shapes with position to something searchable like position 1, position 2, etc
    i suggest you do the same with the names since your doing it....it will be slow and tedious but you would only do this the initial time

    press ALT + F10 and this should help you speed things up

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. "Segeo UI Symbols" showing rectangle instead of symbol
    By eddijensen in forum Access Tables & Databases
    Replies: 0
    Last Post: 02-20-2015, 06:44 AM
  2. Replies: 1
    Last Post: 08-15-2014, 06:00 AM
  3. Replies: 4
    Last Post: 02-20-2014, 02:24 PM
  4. Select/Delete worksheet "Text Boxes" using VBA
    By ConneXionLost in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-12-2012, 06:55 PM
  5. [SOLVED] create links to check boxes marked "good" fair"and "bad"
    By pjb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2006, 09:25 PM
  6. Need help on "Aligning text boxes in a chart sheet"
    By senthilr in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-18-2005, 05:16 AM
  7. [SOLVED] Need help on "Aligning text boxes in a chart sheet"
    By Senthil R in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2005, 09:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1