Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2012, 05:22 AM
gsrikanth gsrikanth is offline vba error (object required) for highlight vowels Windows XP vba error (object required) for highlight vowels Office XP
Competent Performer
vba error (object required) for highlight vowels
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default vba error (object required) for highlight vowels

Sub findfunction()
If (findHL(activedocument.Range, "[56, 47, 44, aeiou]")) = True Then MsgBox "Highlight vowels Done", vbInformation + vbOKOnly, "Vowels Highlight Result"
End Sub

Function findHL(r As Range, s As String) As Boolean
Dim rdup As Range
Set rdup = r.Duplicate
rdup.Find.Wrap = wdFindStop

Do While rdup.Find.Execute(findtext:=s, MatchWildcards:=True) = True
If (Not rdup.InRange(r)) Then Exit Do
rdup.HighlightColorIndex = wdBlue
rdup.Collapse wdCollapseEnd
Loop



findHL = True
End Function
Reply With Quote
  #2  
Old 04-18-2012, 01:06 AM
macropod's Avatar
macropod macropod is offline vba error (object required) for highlight vowels Windows 7 64bit vba error (object required) for highlight vowels Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

You've posted in an Excel forum, but the code looks like it is for MS Word, not Excel. Please clarify.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML parsing & Object variable not set (Error 91) tinfanide Excel Programming 0 12-29-2011 08:43 AM
vba error (object required) for highlight vowels Application-defined or Object-defined error Manit Excel Programming 4 12-08-2011 07:35 PM
Problem: object library invalid or contains references to object definitions aligahk06 Office 0 08-19-2010 12:29 PM
Could not load this object as this object is not present in your computer k.gaurav Office 0 08-17-2009 09:57 PM
find - reading highlight - highlight all / highlight doesn't stick when saved bobk544 Word 3 04-15-2009 03:31 PM

Other Forums: Access Forums

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


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