but this produces a syntax error, presumably because you can have only one. Replace:=wdReplaceAllįor the Find & Replace section I want to do something like: Replacement.Text = "B" 'hard-coded here for testing, but this will 'eventually be referenced to a cell in Excel Text = "A" 'hard-coded here for testing, but this will 'Replacement text must have specific font Here is the code I've got in Word VBA, which I obtained by editing code produced by the recorder: Sub F_R() For example, I want it to Find " A" and replace with " B",īUT only if the " A" is NOT followed by " #" (sharp) or " b" (flat). I'm much more experienced in writing VBA code in Excel than in Word, and I'm fairly confident with transferring the 'Word VBA' code into an Excel module.Īt the moment I'm trying out code entirely in Word, and I've come across a stumbling block. The Find and Replace strings are contained in ranges in an Excel workbook, which is why I want to eventually changing the musical key) of chord symbols in a songsheet in Word. Them with other strings in the same format. The aim of the project is to find specific strings in the open Word document that have length of either one or two characters and are of a certain format, and replace I am trying to write VBA code in Word that I will eventually run from a VBA Excel module.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |