Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-13-2014, 07:56 PM
n00bie-n00b n00bie-n00b is offline Insertbefore an array? help :( Windows 7 32bit Insertbefore an array? help :( Office 2007
Novice
Insertbefore an array? help :(
 
Join Date: Aug 2014
Posts: 17
n00bie-n00b is on a distinguished road
Lightbulb Insertbefore an array? help :(

Skill level-n00b

hi, id like to insert a symbol (an orange triangle) before every instance of a large list of letter combinations (a b, a c, a d ... etc)



here is my broken code *makes my ms word not respond

thanks in advance for any advice....

Code:
Sub insertbefore() 
     '
     ' insertbefore Macro
     '
     '
    Dim range As range 
    Dim i As Long 
    Dim TargetList 
    TargetList = Array("z" & ChrW(9700) & "s", "p" & ChrW(9700) & "p", "p" & ChrW(9700) & "ð", "p" & ChrW(643), "p" & ChrW(9700) & "t", "p" & ChrW(9700) & "s", "b" & ChrW(9700) & "b", "b" & ChrW(9700) & "m", "b" & ChrW(9700) & "t", "t" & ChrW(9700) & "t", "t" & ChrW(9700) & "ð", "t" & ChrW(9700) & "w", "t" & ChrW(9700) & "v", "t" & ChrW(9700) & "l", "t" & ChrW(9700) & "f", "t" & ChrW(9700) & "h", "t" & ChrW(9700) & "s", "t" & ChrW(9700) & "m", "t" & ChrW(9700) & "k" & _ 
    "t" & ChrW(9700) & "j", "t" & ChrW(9700) & "f", "t" & ChrW(9700) & "g", "t" & ChrW(9700) & "p", "t" & ChrW(9700) & "d", "t" & ChrW(9700) & "b", "t" & ChrW(9700) & "r", "t" & ChrW(9700) & "n", "d" & ChrW(9700) & "d", "d" & ChrW(9700) & "ð", "d" & ChrW(9700) & "j", "d" & ChrW(9700) & "t", "d" & ChrW(9700) & "p", "d" & ChrW(9700) & "r", "d" & ChrW(9700) & "b", "d" & ChrW(9700) & "f", "d" & ChrW(9700) & "w", "d" & ChrW(9700) & "n" & _ 
    "d" & ChrW(9700) & "m", "d" & ChrW(9700) & "l", "d" & ChrW(9700) & "g", "d" & ChrW(9700) & "s", "d" & ChrW(9700) & "z", "d ChrW(658)", "d" & ChrW(9700) & "k", "d" & ChrW(9700) & "h", "k" & ChrW(9700) & "k", "k" & ChrW(9700) & "r", "k" & ChrW(9700) & "t", "k" & ChrW(9700) & "w", "k" & ChrW(9700) & "p", "k" & ChrW(9700) & "m", "k" & ChrW(9700) & "d", "k" & ChrW(9700) & "ð", "k" & ChrW(9700) & "b", "k" & ChrW(9700) & "s" & _ 
    "k" & ChrW(9700) & "h", "k" & ChrW(9700) & "f", "g" & ChrW(9700) & "g", "g" & ChrW(9700) & "b", "g" & ChrW(9700) & "s", "g" & ChrW(9700) & "n", "g" & ChrW(9700) & "m", "f" & ChrW(9700) & "f", "v" & ChrW(9700) & "v", ChrW(952) & " " & ChrW(952), ChrW(952) & " h", "ð" & ChrW(9700) & "ð", "ð" & ChrW(9700) & "h", "s" & ChrW(9700) & "s", "z" & ChrW(9700) & "z", "z" & ChrW(9700) & "ð", ChrW(643) & ChrW(9700) & ChrW(643) & _ 
    ChrW(658) & ChrW(9700) & ChrW(658), "m" & ChrW(9700) & "m", "m" & ChrW(9700) & "p", "n" & ChrW(9700) & "n", ChrW(331) & ChrW(9700) & ChrW(331), "h" & ChrW(9700) & "h", "l" & ChrW(9700) & "l", "r" & ChrW(9700) & "r", "w" & ChrW(9700) & "w", "j" & ChrW(9700) & "j") ' put list of terms to find here
    For i = 0 To UBound(TargetList) 
        Set range = ActiveDocument.range 
        With range.find 
            .Text = TargetList(i) 
            .Format = True 
            .MatchCase = True 
            .MatchWholeWord = False 
            .MatchWildcards = False 
            .MatchSoundsLike = False 
            .MatchAllWordForms = False 
            Do While .Execute(Forward:=True) = True 
                range.insertbefore ChrW(9660) 
                .Size = 8 
                .Color = 49407 
                .Superscript = True 
                .Subscript = False 
            Loop 
             
        End With 
         
    Next 
End Sub

Last edited by macropod; 08-13-2014 at 08:12 PM. Reason: Added code tags & formatting
Reply With Quote
 

Tags
complex, connected, insert, macro, n00b



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding information from a array into a table jcorti Word VBA 4 01-10-2014 10:58 PM
Insertbefore an array? help :( Convert String Array to Integer Array from a User Input? tinfanide Excel Programming 4 12-26-2012 08:56 PM
Insertbefore an array? help :( Complex array formula andrei Excel 9 02-03-2012 03:40 AM
How to capture start and ending Ref. Nos. in an array KIM SOLIS Excel 5 09-07-2011 07:43 AM
Look up an array based on user input johnsmb Excel 2 01-07-2011 01:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft