esercitazione con VBA su powerpoint
trasformare un testo in sole maiuscole o minuscole
http://digilander.libero.it/francescovise/vbacodice/cambiare.htm
http://digilander.libero.it/francescovise/vbacodice/cambiare.ppt
http://digilander.libero.it/francescovise/vbacodice/cambiare.GIF
Private Sub CommandButton1_Click()
Dim nome As String
nome = "PADOVA"
ListBox1.AddItem (nome & " " & cambiare(nome))
nome = "PaDoVa"
ListBox1.AddItem (nome & " " & cambiare(nome))
nome = "Padova"
ListBox1.AddItem (nome & " " & cambiare(nome))
nome = "pAdOvA"
ListBox1.AddItem (nome & " " & cambiare(nome))
nome = "12 PADOVA + + "
ListBox1.AddItem (nome & " " & cambiare(nome))
End Sub
Function cambiare(testo As String) As String
Rem scrivere tutto minuscolo
Dim p As Integer
Dim nuovo As String
p = 1
lungo = Len(testo)
While p <= lungo
nuovo = nuovo & LCase(Mid$(testo, p, 1))
p = p + 1
Wend
cambiare = nuovo
End Function
Function cambiare2(testo As String) As String
Rem scrivere tutto maiuscolo
Dim p As Integer
Dim nuovo As String
p = 1
lungo = Len(testo)
While p <= lungo
nuovo = nuovo & UCase(Mid$(testo, p, 1))
p = p + 1
Wend
cambiare2 = nuovo
End Function
Private Sub CommandButton2_Click()
Dim nome As String
ListBox1.AddItem ("------------------------------")
nome = "PADOVA"
ListBox1.AddItem (nome & " " & cambiare2(nome))
nome = "PaDoVa"
ListBox1.AddItem (nome & " " & cambiare2(nome))
nome = "Padova"
ListBox1.AddItem (nome & " " & cambiare2(nome))
nome = "pAdOvA"
ListBox1.AddItem (nome & " " & cambiare2(nome))
nome = "12 PADOVA + + "
ListBox1.AddItem (nome & " " & cambiare2(nome))
nome = "sodio e Potassio sono meTalli "
ListBox1.AddItem (nome & " " & cambiare2(nome))
End Sub
Inviato da: fumarinox
il 01/03/2023 alle 20:47
Inviato da: marabertow
il 24/02/2023 alle 20:59
Inviato da: cassetta2
il 20/12/2020 alle 16:11
Inviato da: cassetta2
il 12/10/2020 alle 10:01
Inviato da: cassetta2
il 05/08/2019 alle 20:30