I need help in making VB Excel macro that would take input from InputBox and convert it from English to Morse and vice versa, then show result in MessageBox. I've been stuck, and I've got no clue how could I make it. Thanks for help in advance <3
Can I get help in making Visual Basic Excel macro for converting Morse code to English language and vice versa
458 Views Asked by Saša Bugarin At
2
There are 2 best solutions below
2

Please see the following (just for your reference - you may need to convert the codes to VBA, but I believe you can do it )
If txtInput.Text = "a" Then
lblStatus.Caption = ".-"
End If
If txtInput.Text = "b" Then
lblStatus.Caption = "-..."
End If
If txtInput.Text = "c" Then
lblStatus.Caption = "-.-."
End If
If txtInput.Text = "d" Then
lblStatus.Caption = "-.."
End If
If txtInput.Text = "e" Then
lblStatus.Caption = "."
End If
If txtInput.Text = "f" Then
lblStatus.Caption = "..-."
End If
If txtInput.Text = "g" Then
lblStatus.Caption = "--."
End If
If txtInput.Text = "h" Then
lblStatus.Caption = "...."
End If
If txtInput.Text = "i" Then
lblStatus.Caption = ".."
End If
If txtInput.Text = "j" Then
lblStatus.Caption = ".---"
End If
If txtInput.Text = "k" Then
lblStatus.Caption = "-.-"
End If
If txtInput.Text = "l" Then
lblStatus.Caption = ".-.."
End If
If txtInput.Text = "m" Then
lblStatus.Caption = "--"
End If
If txtInput.Text = "n" Then
lblStatus.Caption = "-."
End If
If txtInput.Text = "o" Then
lblStatus.Caption = "---"
End If
If txtInput.Text = "p" Then
lblStatus.Caption = ".--."
End If
If txtInput.Text = "q" Then
lblStatus.Caption = "--.-"
End If
If txtInput.Text = "r" Then
lblStatus.Caption = ".-."
End If
If txtInput.Text = "s" Then
lblStatus.Caption = "..."
End If
If txtInput.Text = "t" Then
lblStatus.Caption = "-"
End If
If txtInput.Text = "u" Then
lblStatus.Caption = "..-"
End If
If txtInput.Text = "v" Then
lblStatus.Caption = "...-"
End If
If txtInput.Text = "w" Then
lblStatus.Caption = ".--"
End If
If txtInput.Text = "x" Then
lblStatus.Caption = "-..-"
End If
If txtInput.Text = "y" Then
lblStatus.Caption = "-.--"
End If
If txtInput.Text = "z" Then
lblStatus.Caption = "--.."
End If
If txtInput.Text = "0" Then
lblStatus.Caption = "-----"
End If
If txtInput.Text = "1" Then
lblStatus.Caption = ".----"
End If
If txtInput.Text = "2" Then
lblStatus.Caption = "..---"
End If
If txtInput.Text = "3" Then
lblStatus.Caption = "...--"
End If
If txtInput.Text = "4" Then
lblStatus.Caption = "....-"
End If
If txtInput.Text = "5" Then
lblStatus.Caption = "....."
End If
If txtInput.Text = "6" Then
lblStatus.Caption = "-...."
End If
If txtInput.Text = "7" Then
lblStatus.Caption = "--..."
End If
If txtInput.Text = "8" Then
lblStatus.Caption = "---.."
End If
If txtInput.Text = "9" Then
lblStatus.Caption = "----."
End If
English to Morse Code
Dictionary object
, I stuck with the arrays as an interesting alternative.The Code