Question

Create an address book. Given a list of people add

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: method definition Sub sample () variable decalratiorn Dim a As Range Dim b As Range Dim c As String Dim arr() As Stset the offset Set a .Offset (1) .Resize (.Rows.Count 1) .SpecialCells (xlCel1TypeVisible) if error came go to 0 On Error GoEnd Sub Output: Excel sheet: Bookl Microsoft Excel (Product Activation Fail 1回 File Home Insert Page Layout Formulas Data RevInput message box: Microsoft Excel Please enter the person name OK Cancel W John Output message box: Microsoft Excel W John 2

Copyable code:

'method definition

Sub sample()

   

    'variable decalration

    Dim a As Range

    Dim b As Range

    Dim c As String

    Dim arr() As String

    Dim str As String

    c = InputBox("Please enter the person name")

   

    'input is not enter then exit the program

    If Len(Trim(c)) = 0 Then Exit Sub

    'set the active sheet

    With Intersect(ActiveSheet.UsedRange, ActiveSheet.Columns("A"))

        'set the autofilter

        .AutoFilter 1, c

        'error checking

        On Error Resume Next

        'set the offset

        Set a = .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible)

        'if error came go to 0

        On Error GoTo 0

        'end the autofilter

        .AutoFilter

    'end the function

    End With

  

    If a Is Nothing Then

        'display the message box

        MsgBox c & " could not be found in the address."

    Else

        For Each b In a.Cells

            str = b.Worksheet.Cells(b.Row, "B").Text

            arr = Split(str, ",")

            MsgBox b & vbNewLine & arr(0) & vbNewLine & arr(1) & vbNewLine & arr(2)

        Next b

    End If

End Sub

Add a comment
Know the answer?
Add Answer to:
Create an address book. Given a list of people addresses, create a procedure that allows a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PHP Programming Question. Use the techniques you learned so far to create an Address Book application...

    PHP Programming Question. Use the techniques you learned so far to create an Address Book application that stores names, e-mail addresses, and phone numbers in a text file. Validate all input fields and include functionality that allows the user to view the address book. Also, include code that sorts the address book by name and deletes duplicate entries. Each page in the application should have a link back to the main page. Be creative and add extra features if you...

  • Requirements Create an Address Book class in Java for general use with the following behaviors: 1....

    Requirements Create an Address Book class in Java for general use with the following behaviors: 1. Constructor: public Address Book Construct a new address book object. • A contact has four fields: first name, last name, email and phone. (There could be more information for a real contact. But these are sufficient for the assignment.) . The constructor reads from the disk to retrieve previously entered contacts. If previous contacts exist, the address book will be populated with those contacts...

  • In Java. Write a GUI contact list application. The program should allow you to input names...

    In Java. Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...

  • C++ : Please include complete source code in answer This program will have names and addresses...

    C++ : Please include complete source code in answer This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record. When the program is run, it will search for a birthday or an anniversary using the current date to compare with the saved date. It will then generate the appropriate card message. Because this will be an interactive system, your program should begin by displaying a...

  • User Profiles Write a program that reads in a series of customer information -- including name,...

    User Profiles Write a program that reads in a series of customer information -- including name, gender, phone, email and password -- from a file and stores the information in an ArrayList of User objects. Once the information has been stored, the program should welcome a user and prompt him or her for an email and password The program should then use a linearSearch method to determine whether the user whose name and password entered match those of any of...

  • Using C# Language Develop a Visual C# .NET application that performs a colour control operation. The...

    Using C# Language Develop a Visual C# .NET application that performs a colour control operation. The main form contains a reset button and sets the form's background colour according to the colour values indicated by the colour control objects. Each colour control object is controlled by a corresponding colour control form which provides a progress bar to show the value (in the range 0 to 255) of the corresponding colour control object. The user can click the increase (+) or...

  • C++ Programming

    PROGRAM DESCRIPTIONIn this project, you have to write a C++ program to keep track of grades of students using structures and files.You are provided a data file named student.dat. Open the file to view it. Keep a backup of this file all the time since you will be editing this file in the program and may lose the content.The file has multiple rows—each row represents a student. The data items are in order: last name, first name including any middle...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • JAVA project PLEASE complete/ create project with comments in the programming explaining everything Text file Year...

    JAVA project PLEASE complete/ create project with comments in the programming explaining everything Text file Year of storm/ Name of storm/ mmdd storm started/ mmdd storm ended/ magnitude of storm/ //made up data 2004/Ali/1212/1219/1 2003/Bob/1123/1222/3 1980/Sarah/0123/0312/0 1956/Michael/1211/1223/4 1988/Ryan/0926/1019/ 1976/Tim/0318/1010/0 2006/Ronald/0919/1012/2 1996/Mona/0707/0723/1 2000/Kim/0101/0201/1 2001/Jim/1101/1201/3 Text file Class storm{ private String nameStorm; private int yearStorm; private int startStorm; private int endStorm; private int magStorm; public storm(String name, int year, int start, int end, int mag){ nameStorm = name; yearStorm = year; startStorm...

  • This project will use The Vigenere Cipher to encrypt passwords. Simple letter substitution ciphers are ones...

    This project will use The Vigenere Cipher to encrypt passwords. Simple letter substitution ciphers are ones in which one letter is substituted for another. Although their output looks impossible to read, they are easy to break because the relative frequencies of English letters are known. The Vigenere cipher improves upon this. They require a key word and the plain text to be encrypted. Create a Java application that uses: decision constructs looping constructs basic operations on an ArrayList of objects...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT