Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Creating popups in Excel?

I want to write an Excel worksheet that when you open it, the first thing that happens is a popup window that asks the user to enter data into 3 or 4 fields. How would I do this?

Update:

I don't just want a popup. I want the popup to prompt the user for information in 3 or 4 fields. The user would then type the info into those fields, and the program should transfer that data to the desired cells on the spreadsheet.

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    A Comment field will allow you to create a simple popup like message, but that means that Comments will need to be always turned on in the Options for MS-Excel.

    To get a more sophisticated message to display will require VBA coding, especially if you want the data to be asked and entered by the messaging routine. I will not be able to give exact details, since you did not specify which cells you wanted to be filled, nor are you sure whether it is 3 or 4 that this is supposed to handle. But here is an example:

    Option Explicit

    Public strTitle2 As String

    Private Sub Workbook_Open()

    Do

    strTitle2 = InputBox("Please enter one of the following three values: " & vbCrLf & _

    " • Board" & vbCrLf & _

    " • Staff" & vbCrLf & _

    " • All" & vbCrLf & _

    "This will be used within the report's Title.", _

    "Acquire Report Title", "All")

    strTitle2 = StrConv(strTitle2, vbProperCase)

    If strTitle2 = "Board" Or strTitle2 = "Staff" Or strTitle2 = "All" Then

    Range("A1").Select

    Selection.Value = strTitle2

    Else

    MsgBox "Apparently you are incapable of following simple " & vbCrLf & _

    "directions, so give it another attempt!!!"

    strTitle2 = vbNullString

    End If

    Loop Until strTitle2 <> vbNullString

    End Sub

  • Anonymous
    1 decade ago

    oops

    try this...sorry

    Sub auto_open()

    MsgBox "Type your message here"

    End Sub

Still have questions? Get your answers by asking now.