Consulting

Results 1 to 3 of 3

Thread: Case Sensitive Macro Help

  1. #1
    VBAX Regular
    Joined
    May 2015
    Posts
    34
    Location

    Case Sensitive Macro Help

    Hi i currently have this macro which works perfectly as long as it is in lower case.

    I would like to to work with both upper and lower case as multiple people use the work book and it is so easy to have caps lock on by mistake. Probably an easy fix for some of you guys

    All help greatly appreciated


    Sub PrintandClear()
    
        Sheets("Financial Summary").Select
        Range("B5").Select
        
        Do While ActiveCell.Value <> ""
            ActiveCell.Offset(1, 0).Select
            
        Loop
        
        ActiveCell.Value = Range("fsheetno")
        ActiveCell.Offset(0, 1).Value = Range("fdeptno")
        Select Case Range("fvat")
        Case "y"
            ActiveCell.Offset(0, 2).Value = Range("fnet")
        Case "n"
            ActiveCell.Offset(0, 2).Value = Range("fgross")
        End Select
        ActiveCell.Offset(0, 3).Value = Range("fvat")
        ActiveCell.Offset(0, 4).Value = Time
        
        Sheets("Financial").Select
        
    
    
        ActiveWindow.SelectedSheets.PrintOut Copies:=1
    
    
        clearfinancials
        
        Range("C5").Select
         
    End Sub

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Handles "yY,n,N"
    Select Case LCase(Range("fvat") )
    Handles y,Y,n,N,Yes,yes,no,No, Nien, Yeah mate.
    Select Case Left(LCase(Trim(Range("fvat"))), 1)
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    May 2015
    Posts
    34
    Location
    Perfect, Thanks

Posting Permissions

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