Results 1 to 12 of 12

Make macro work with upper case and lower case

Threaded View

Caitlin535 Make macro work with upper... 11-06-2019, 12:37 PM
shg Re: Make macro work with... 11-06-2019, 12:41 PM
Caitlin535 Re: Make macro work with... 11-06-2019, 12:56 PM
Pete_UK Re: Make macro work with... 11-06-2019, 12:44 PM
Caitlin535 Re: Make macro work with... 11-06-2019, 12:58 PM
nigelog Re: Make macro work with... 11-06-2019, 12:58 PM
Caitlin535 Re: Make macro work with... 11-06-2019, 12:59 PM
Fluff13 Re: Make macro work with... 11-06-2019, 12:59 PM
Norie Re: Make macro work with... 11-06-2019, 01:00 PM
shg Re: Make macro work with... 11-06-2019, 01:02 PM
Caitlin535 Re: Make macro work with... 11-06-2019, 01:16 PM
Fluff13 Re: Make macro work with... 11-06-2019, 01:19 PM
  1. #1
    Registered User
    Join Date
    02-23-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Make macro work with upper case and lower case

    Hello! I have the following Macro (below) in a spreadsheet I use to record work times for my employees. In column C there is a dropdown in which they are supposed to choose "ARRIVED," and then a timestamp appears in both column D and P. Similar for column E - they're supposed to select "DEPARTED" from a dropdown menu and then it enters a timestamp in both column F and Q.

    The trouble is, sometimes employees type "Arrived" or "Departed" instead of using the dropdowns. Because these are the correct words the dropdown error function doesn't alert, but unfortunately the Macro doesn't run. Is there a way to make the Macro not case-dependent?

    Thanks!

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo Handler
    If Target.CountLarge > 1 Then Exit Sub
    If Target.Column = 3 And Target.Value = "ARRIVED" Then
    Application.EnableEvents = False
    Target.Offset(0, 1) = Format(Now(), "hh:mm")
    Target.Offset(0, 13) = Format(Now(), "mm-dd-yyyy hh:mm")
    Application.EnableEvents = True
    End If
    
    If Target.Column = 3 And Target.Value = "(Absent)" Then
    Application.EnableEvents = False
    Target.Offset(0, 2) = "(Absent)"
    Target.Offset(0, 13) = "(Absent)"
    Application.EnableEvents = True
    End If
    
    If Target.Column = 5 And Target.Value = "DEPARTED" Then
    Application.EnableEvents = False
    Target.Offset(0, 1) = Format(Now(), "hh:mm")
    Target.Offset(0, 12) = Format(Now(), "mm-dd-yyyy hh:mm")
    Application.EnableEvents = True
    End If
    
    Handler:
    Application.EnableEvents = True
    
    End Sub
    Last edited by Caitlin535; 11-06-2019 at 12:56 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Change name format including adjusting upper case to lower case
    By johnmitch38 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-26-2019, 07:53 AM
  2. Replies: 1
    Last Post: 07-14-2016, 05:51 AM
  3. Replies: 7
    Last Post: 04-18-2014, 04:11 PM
  4. [SOLVED] Lower Case to Upper Case but No Auto Correction : Solved by Mod (6StringJazzer)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-27-2014, 10:44 AM
  5. Make Upper Case in cells become lower case
    By davidx in forum Excel General
    Replies: 2
    Last Post: 12-02-2013, 08:40 AM
  6. Replies: 2
    Last Post: 12-09-2005, 05:15 AM
  7. [SOLVED] Changing file in all upper case to upper and lower case
    By Sagit in forum Excel General
    Replies: 14
    Last Post: 08-25-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1