Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-14-2019, 11:55 PM
jhansrod jhansrod is offline If condition not working. Windows 10 If condition not working. Office 2016
Novice
If condition not working.
 
Join Date: Jun 2019
Posts: 16
jhansrod is on a distinguished road
Default If condition not working.

Hi

In the code below, why would OFFICEHEAD always be set to "JUST HEADER".

Code:
With ActiveDocument.SelectContentControlsByTitle("A-OFFICE")(1)
        .LockContents = False
        .Range.Text = Split(StrDetails, "|")(0)
        .LockContents = False
   Select Case .Range.Text
     Case "OFFICE01"
       With ActiveDocument.SelectContentControlsByTitle("OFFICEHEAD")(1)
         .LockContents = False
         .Range.Text = "OFFICE01 HEADER"
         .LockContents = True
       End With
     Case "OFFICE02"
       With ActiveDocument.SelectContentControlsByTitle("OFFICEHEAD")(1)
         .LockContents = False
         .Range.Text = "OFFICE02 HEADER"
         .LockContents = True
       End With
      Case Else
        With ActiveDocument.SelectContentControlsByTitle("OFFICEHEAD")(1)
          .LockContents = False
          .Range.Text = "JUST HEADER"
          .LockContents = True
        End With
   End Select
End With


Thank you
J
Reply With Quote
 

Tags
if then else;case

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
If condition related query... LearnerExcel Excel 1 03-12-2018 01:37 AM
If condition not working. How to use if condition to for this ... LearnerExcel Excel 1 12-19-2016 02:14 PM
If condition not working. Use Two (concatenate) Fields If Condition Is Met (If... Then... Else) SoonerLater Mail Merge 1 09-30-2015 05:40 PM
If condition not working. Condition formating for date? yabbah Excel 2 05-31-2012 12:38 PM
If condition not working. check with condition karti Word 2 03-15-2011 06:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:41 AM.


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