VBA Program for Data Validation/ Drop Down list



Sub ProgramValidate()
Dim Choices As String
Choices = "1. Started, 2. Not Started, 3. Finished, 4. Revision, 5. Revision1"
Range("A1:A50").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Choices
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
Conditional sum
Sub test()
Dim r As Integer
Dim c As Integer
Dim sum As Double
sum = 0
For r = 1 To 10
If Cells(r, 1).Value = "Jan" Then
sum = sum + Cells(r, 3).Value
End If
Next
Cells(11, 3).Value = sum
End Sub



Change this text ["1. Started, 2. Not Started, 3. Finished, 4. Revision, 5. Revision1"] to suit your needs.


(Click on the Image to Enlarge it)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.