Solved

Input Box

Posted on 2002-03-27
2
154 Views
Last Modified: 2010-05-02
Hi, I need to know how would i go about setting up some type of script on a command button that on an excel worksheet it will search say cell a24, if the text "CB" appears anywhere in that cell an input box will appear asking for the date.
0
Comment
Question by:sandramac
2 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 15 total points
ID: 6899283
Hi Sandramac,

Still got nothing back on those other questions

Private Sub CommandButton1_Click()

Dim rng As Range

    rng = Cells.Find(What:="CB", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
       
    rng.Value = InputBox("Give the Date", "Date Input", "Like dd/mm/yyyy or something")
   
End Sub

HTH:O)Bruintje

0
 
LVL 13

Expert Comment

by:WJReid
ID: 6899614
Hi Sandramac,

Try this code.
Sub askdate()
If Range("A24").Text Like ("CB*") Or Range("A24").Text Like ("*CB*") Or Range("A24").Text Like ("*CB*") Then
Ask = Application.InputBox(prompt="Enter Today's Date")
End If
End Sub
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question