PDA

View Full Version : [SOLVED] Case Sensitive Macro Help



GribbiN
10-27-2015, 09:18 AM
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

SamT
10-27-2015, 10:07 AM
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)

GribbiN
10-28-2015, 03:24 PM
Perfect, Thanks