![]() |
|
|
|
#1
|
|||
|
|||
|
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- |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Multiple If statements,
|
Jamal NUMAN | Excel | 16 | 11-15-2022 11:59 PM |
| Countif statements | Alaska1 | Excel | 5 | 02-05-2015 07:55 PM |
Using IF statements
|
stuwoolf | Excel | 2 | 01-10-2015 01:58 PM |
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 |