![]() |
#2
|
||||
|
||||
![]()
Hi Paulsh,
Have you considered using autotext function? Alternatively, you could store both the initials and names in a single macro: Code:
Sub AddSender() Dim StrNames As Variant, StrInits As Variant, StrSender As String, i As Long StrSender = InputBox("Enter Sender's Initials:", "SENDER") If StrSender = "" Then Exit Sub StrInits = Array("mc", "yz", "ar") StrNames = Array("Michael Carlton", "Yasmin Zanders", "Andy Ryan") For i = 0 To UBound(StrInits) If StrInits(i) = StrSender Then Selection.InsertAfter StrNames(i) Exit For End If Next End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Dom37 | Word VBA | 2 | 10-31-2011 03:28 AM |
Call Excel from Word | donlincolnmsof | Word | 0 | 10-14-2011 05:02 PM |
Help with VBA macro - Variable input | sc30317 | Excel Programming | 0 | 08-31-2011 01:00 PM |
![]() |
Eduardo | Word VBA | 5 | 06-15-2009 01:55 AM |
![]() |
KramerJ | Excel | 2 | 05-11-2009 11:33 AM |