Solved

Input Box

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now