' Excel nema opciju za automatsku konverziju teksta već je potrebna dodatna kolona sa funkcijama UPPER, LOWER i PROPER a zatim se rezultat kopira u obliku vrijednosti. ' Ovaj makro tekst u odabranim ćelijama konvertuje u velika ("V") , mala ("M") ili početna velika slova ("P"). Option Compare Text ' makes code case-insensitive, so it doesn't matter if user enters "M" or "m" Sub ChangeCase() Dim Rng As Range Dim CaseTyppe As String ' this is "M" for lowercase, "V" for uppercase and "P" for propercase On Error Resume Next Err.Clear With Application .ScreenUpdating = False ' prevents flickering and speeds up execution .EnableEvents = False CaseMode = InputBox("Unesite M za sva mala , V za sva velika ili P za velika početna slova.") 'prompt for user to select case (M, V or P) For Each Rng In Selection.Cells If Err.Number = 0 Then Select Case CaseMode ' depending on user input, case is changed, as follows: Case Is = "M", "Mala" Rng.Value = StrConv(Rng.Text, vbLowerCase) ' changed to lowercase Case Is = "V", "Velika" Rng.Value = StrConv(Rng.Text, vbUpperCase) ' changed to uppercase Case Is = "P", "Početna", "pocetna" Rng.Value = StrConv(Rng.Text, vbProperCase) ' changed to propercase Case Else MsgBox ("Unesite M za sva mala , V za sva velika ili P za velika početna slova.") ' warning if wrong value or nothing is entered End ' stops execution if wrong value or nothing is entered End Select End If Next Rng .EnableEvents = True .ScreenUpdating = True ' reverting to original settings End With End Sub