Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Open a new workbook in Excel, get into the VBE, and insert a module into this new workbook. Type the following code in the Code

Open a new workbook in Excel, get into the VBE, and insert a module into this new workbook. Type the following code in the Code window. Make sure there is no Option Explicit line at the top of the code window. (If there is one, delete it.)

Sub EnterUserNameSlowly( )

Range("A1").Value = "The user of this copy is Excel is listed below."

yourName = Application.UserName

nChars = Len(yourName)

For i = 1 To nChars

Range("A3").Value = Left(yourName, i)

newHour = Hour(Now( ))

newMinute = Minute(Now( ))

newSecond = Second(Now( )) + 1

waitTime = TimeSerial(newHour, newMinute, newSecond)

Application.Wait

waitTime

Next

End Sub

Next, return to Sheet1 of this workbook, add a button and assign the EnterUserNameSlowly sub to it, and then run the program by clicking the button. Can you now explain what the code is doing? (If you like, look up the Wait method of the Application object in the Object Browser for online help.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

2. What does the consumer price index measure?

Answered: 1 week ago