Solved

Input Box

Posted on 2002-03-27
2
155 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 183
how to know if my Checkbox is True in VB6.0? 9 60
Child Form in front 4 49
VBA: loop recent folder and copy txt file. 8 36
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

820 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