Thread: [Solved] Help with if then statements
View Single Post
 
Old 07-13-2015, 02:37 PM
brent chadwick brent chadwick is offline Windows 8 Office 2013
Advanced Beginner
 
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