A community of 30,000 US Transcriptionist serving Medical Transcription Industry
I don't know where to begin with trying to record a macro for this need myself. On my main account, we're required to list meds without any following punctuation, but due to other MTSOs also subbing on it (who apparently don't have any specs or just don't have to follow the same specs we do), the lists invariably come through on VR with totally inconsistent punctuation. Such as this:
MEDICATIONS:
Ativan,
Zofran
Dexamethasone.
Diltiazem
Lanoxin.
But should be this:
MEDICATIONS:
Ativan
Zofran
Dexamethasone
Diltiazem
Lanoxin
Is there any way to make a macro that will delete the periods/commas when they're included behind the individual meds? (including ignoring when there is no punctuation at all, as should be, as with Zofran and Diltiazem in my first example above ... this being my main problem in trying to figure out how to make a macro for this since I can't just drop down a line and delete the last character, which may just be the last letter of the med if no comma or period there)
Another issue is that there's not always a consistent heading (sometimes CURRENT MEDICATIONS, etc., but MEDICATIONS is usually part of the heading, so I was trying to think of a way to search for MEDICATIONS in caps and disregard anything else before or after and then drop down one line to start the code running that will delete a comma or period. Hopefully that makes sense.
Thanks for any ideas. And once again, thanks so much for your amazing help in the past. It's made my editing VR exceedingly less frustrating.
I would put on a hot key combo. This looks for the first comma or period to the left, deletes it, and then returns to original insertion point. If you need to undo it just use control-Z. Position your cursor at very end of the meds list, and run it until all the periods and commas are gone.
Sub FindLastCommaPeriod()
With Selection
.TypeText "^"
.MoveUntil cset:=",.", Count:=wdBackward
.TypeBackspace
.MoveUntil cset:="^", Count:=wdForward
.Delete
End With
End Sub
Of concern, does your med list ever contain dosages? (For example, Synthroid .125 mcg?) This macro would delete any decimals, so does this need to be changed to accommodate decimals?
I would put this on a hot key combo for ease of use.
Sub RemoveCommaPeriod2()
' Macro created 5/17/2014 by WordExpress Transcriptions
' To delete unwanted punctuation in medication list
' Position cursor at very end of medication list
Selection.TypeText "^"
Selection.MoveUntil cset:=":", Count:=wdBackward
GoSub RemovePunc
While Char <> "^"
GoSub RemovePunc
Wend
Selection.TypeBackspace
Exit Sub
RemovePunc:
Char = Selection.Text
If Char = "." Or Char = "," Then Selection.Delete:Return
Selection.MoveRight unit:=wdCharacter
Return
End Sub
Sub RemoveCommaPeriod3()
' Macro created 5/17/2014 by WordExpress Transcriptions
' To delete unwanted punctuation in list; protects decimals
' Position cursor at very end of medication list
Dim Char As Variant
Selection.TypeText "^"
Selection.MoveUntil cset:=":", Count:=wdBackward
GoSub RemovePunc
While Char <> "^": GoSub RemovePunc: Wend
Selection.TypeBackspace
Exit Sub
RemovePunc:
Char = Selection.Text
If Char = "," Then Selection.Delete: Return
If Char = "." Then GoSub Check4Number: Return
Selection.MoveRight unit:=wdCharacter:Return
Check4Number:
Selection.MoveRight unit:=wdCharacter: Char = Asc(Selection.Text)
If Char > 47 And Char < 58 Then Return
Selection.TypeBackspace: Return
End Sub