QuestionQuestion

Using VBA, develop a simple application that asks a user to input two letters of the alphabet. The application then counts the # of letters BETWEEN the user’s indicated letters. It should do this continuously in alphabetic order. You should include:
• 2 user forms, one for user inputs and one that displays the letter count
• A way for the user to return to the input form and input different letters.
• You must include a system for error trapping. The user should not be able to enter numerical values or leave inputs blank.
• You must use a ComboBox for letter inputs allowing the user to both manually enter the letter or select a letter from a drop down list.
• The system should be able to distinguish which way to count letters. (Example: There are 2 letters between A and D, but 22 letters between D and A.
• The program should run automatically when opened. (Hint: ThisWorkbook_Open)

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Private Sub CommandButton1_Click()
    Dim letter1 As Integer
    Dim letter2 As Integer
   
    ' gets input letter and turn them into number
    letter1 = Get_Input(ComboBox1.Value)
    letter2 = Get_Input(ComboBox2.Value)
    ' error trap
    If letter1 = 0 Or letter2 = 0 Then
       MsgBox "You should not be able" & _
       " to enter numerical values, leave inputs blank" & _
       " or more than one letter in each box "
    Else
       ' show the output
       Dim output As UserForm2
       Set output = New UserForm2
       output.letter1 = letter1
       output.letter2 = letter2...
$35.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Visual Basic Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats