Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2015, 02:13 PM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default


Thanks Greg for your reply. I get compile error-"invalid use of the keyword Me." I looked that one up and Me is only supposed to used in "class" modules. What can I substitute for it? Thanks-
Reply With Quote
  #2  
Old 07-13-2015, 02:18 PM
gmaxey gmaxey is offline Help with if then statements Windows 7 32bit Help with if then statements Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,639
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Me is the userform class object. The code could go in the DD click event or a command button click event. You don't really have to use Me.

If DD1.Value =

Should work as well
Reply With Quote
  #3  
Old 07-13-2015, 02:37 PM
brent chadwick brent chadwick is offline Help with if then statements Windows 8 Help with if then statements Office 2013
Advanced Beginner
Help with if then statements
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default

Still stalling on the If line. This is an exit macro when the drop-down is selected. Here's the code, hope I'm posting correctly-if not correct me. Thanks

Code:
Sub LockDD1()
'
' Lock DD1 Macro
'
'
          Application.ScreenUpdating = False
    If ActiveWindow.View.Type = wdPageView Then
        ActiveWindow.ActivePane.View.Type = wdNormalView
    Else
        ActiveWindow.View.Type = wdPageView
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Then
        ActiveWindow.ActivePane.View.Type = wdPageView
    Else
        ActiveWindow.ActivePane.View.Type = wdNormalView
    End If
    If DD1.Value = "1790" Then
    
     'Column box
    ActiveDocument.FormFields.Add Selection.Range, wdFieldFormTextInput
    Selection.PreviousField.Select
    With Selection.FormFields(1)
        .Name = "Column1790"
        .Enabled = True
        With .TextInput
            .EditType Type:=wdRegularText, Default:="X", Format:= _
                "Lower case"
            .Width = 0
        End With
    End With
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.TypeText Text:=", "
    



End If
    
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with if then statements Multiple If statements, Jamal NUMAN Excel 16 11-15-2022 11:59 PM
Countif statements Alaska1 Excel 5 02-05-2015 07:55 PM
Help with if then statements Using IF statements stuwoolf Excel 2 01-10-2015 01:58 PM
Help with if then statements count if statements Alaska1 Excel 1 05-14-2014 08:21 AM
IF statements that shifts to right. kent Excel 0 01-19-2006 02:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:26 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