Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 03-19-2022, 09:54 PM
Bikram Bikram is offline Checking whether the selected lies with in an equation field Windows 10 Checking whether the selected lies with in an equation field Office 2007
Advanced Beginner
Checking whether the selected lies with in an equation field
 
Join Date: Jul 2021
Location: Nepal
Posts: 97
Bikram is on a distinguished road
Default

I am very grateful for your reply, Paul. I am sorry that I failed to describe in detail the question or problem. I was trying to insert commas inside numerical figures and trying to code like if the numerical text lies within field {(eq /f(2150,2204)} then ignore the comma.

Again, I want to thank you for your effort.

Your code flags every character as True whether it is inside the field or not.
However, I found a way to get my work done but it may be lengthy and error prone.

Code:
   If .Range.Characters(1).Previous.Text = "." Or .Range.Characters(1).Previous.Text = "," Or .Range.Characters(1).Previous.Previous.Text = "‚" Then
    rng.Fields.ToggleShowCodes
    Selection.MoveRight wdWord, 1, wdExtend
  
     If Selection.Range.Fields.Count = 1 Then ' I used this approach, it is manual but get the jobs done
    rng.Fields.ToggleShowCodes
    rng.Select
    GoTo exx
    Else
    rng.HighlightColorIndex = wdRed
    Selection.MoveRight wdCharacter, 1
    End If
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Activate (show) a Drop-down form field when another drop-down form field is selected from Jentis Word VBA 1 04-19-2018 09:42 PM
Need a VBA func. that tells if a point lies above/below 3D polygon surface gonurvia Excel Programming 0 03-29-2017 01:40 AM
Checking whether the selected lies with in an equation field Get Name of Selected/Active Form Field NumberCruncher Word VBA 8 01-20-2014 11:36 PM
Insert an image that lies in two rows raistlin Word 1 03-10-2013 02:11 PM
Checking whether the selected lies with in an equation field Word Equation field codes mkarthic Word 1 12-02-2011 02:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:42 PM.


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