View Single Post
 
Old 06-02-2025, 11:47 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,366
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by victorybadges View Post
thank you for the latest instructions
the result was a colon prefix and dots instead of spaces which I have been able to remove by replacing this
StrTxt = Split(.SelectedItems(j), "")(UBound(Split(.SelectedItems(j), "")))
StrTxt = ": " & Left(StrTxt, InStrRev(StrTxt, "."))

with this

StrTxt = Split(.SelectedItems(j), "")(UBound(Split(.SelectedItems(j), "")))
StrTxt = Left(StrTxt, InStrRev(StrTxt, "."))
Your code makes no sense at all. There is no point in having a line like:
StrTxt = Split(.SelectedItems(j), "")(UBound(Split(.SelectedItems(j), "")))
It does nothing.

And "the result was a colon prefix and dots instead of spaces" is bizzarre - the code doesn't replace your periods or spaces!
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote