We help IT Professionals succeed at work.

Excel Validation lists

dawber39
dawber39 asked
on
There is an Excel addin that sales man use to create orders for the company. The addin exports to a comma delimited file for pickup by an SAP database based in Oracle.

There are three columns that represent  that represent each customer. Every third column starting with I to L to O and so on for 100 columns, and with Rows ranging from 17 up to 2500. Each cell potentially in the I,L, and O columns for those stores, represents a Unit of Measure (UOM) for the product that is ordered in the A column. There is a hidden validation list thart presents a dropdown box for the UOM. The validation list is all Uppercase - otherwise it will not be picked up by the importing SAP.

Salesmen have a habit of entering the UOM in lowercase, and it is accepted by the worksheet regardless of the Uppercase in the Validation sheet.

Is there away to ensure that the cell must be entered in Uppercase, changes to Uppercase on losing focus, or can be something be manipulated with the Validation list itself?
Comment
Watch Question

dawber39Database Analyst / Application Developer

Author

Commented:
Oh... it is a Macro Enabled Workbook
Hi,

What you can do is to use this macro that will automatically put in Uppercase in column A:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i, LastRow
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LastRow
Cells(i, "A").Value = UCase(Cells(i, "A").Value)
Next
End Sub

Open in new window


See example below in attachment
uppercase-example.xlsm
If you want to set multiple columns to be forced on Uppercase, you can also do something like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 Dim MyCols As Variant
    Dim i As Integer
    Dim LastRow As Long
    Dim MyRow As Long

    MyCols = Array("I", "L", "O")

Application.ScreenUpdating = False
    For i = LBound(MyCols) To UBound(MyCols)
        LastRow = Cells(Rows.Count, MyCols(i)).End(xlUp).Row
        For MyRow = 1 To LastRow
            Cells(MyRow, MyCols(i)) = UCase(Cells(MyRow, MyCols(i)))
        Next MyRow
    Next i
Application.ScreenUpdating = True
End Sub

Open in new window

This page gives you both a Data Validation method to force your users into entering things in upper case in the first place or, in my opinion more humane, but possibly inefficient, to upper-case the entire spreadsheet whenever something changes.

http://www.extendoffice.com/documents/excel/1722-excel-force-uppercase-lowercase-proper-case.html

For what you paid your SAP people, you'd think they would have handled this seamlessly!
dawber39Database Analyst / Application Developer

Author

Commented:
Thanks - I will post another question related to this - will call it Pt II
dawber39Database Analyst / Application Developer

Author

Commented:
Awesome as usual  - best site around
Thanks to you for using Experts Exchange, and we are always happy to help.
dawber39Database Analyst / Application Developer

Author

Commented:
No Thanks Necessary Jean.... I can always find an answer or direction here. I'm not a novice, but there are times I need help. Even if I cant get an answer - this site sends my mind in a direction that leads me to an answer, and I have come back to share it with those involved - so they have it too.

Thank You so much