ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If a specified cell has any text entered in it, this cell will ent (https://www.excelbanter.com/excel-worksheet-functions/239672-if-specified-cell-has-any-text-entered-cell-will-ent.html)

Sara Wiseman

If a specified cell has any text entered in it, this cell will ent
 
If I want a cell to check to see if another cell has text in it, and then if
it does have text then it enters the date, what formula would I use? I have
part of it figured out:

=IF(ISTEXT(B2), "", "")

What I am missing is: =IF(ISTEXT(B2), "how do I get it to enter the date
here?", "")

I cannot figure out what goes inbetween the fist set of " to get it to enter
today's date. Please help me if possible, I'm going NUTS!. Thank you.

Sara

Eduardo

If a specified cell has any text entered in it, this cell will ent
 
Hi,
try

=IF(ISTEXT(B2),TODAY(), "")

format the cell to read date

"Sara Wiseman" wrote:

If I want a cell to check to see if another cell has text in it, and then if
it does have text then it enters the date, what formula would I use? I have
part of it figured out:

=IF(ISTEXT(B2), "", "")

What I am missing is: =IF(ISTEXT(B2), "how do I get it to enter the date
here?", "")

I cannot figure out what goes inbetween the fist set of " to get it to enter
today's date. Please help me if possible, I'm going NUTS!. Thank you.

Sara


Bernie Deitrick

If a specified cell has any text entered in it, this cell will ent
 
Sara,

You need to use an event - either the change or calculate event will work. Copy the code below,
right-click the sheet tab, select "View Code" and paste the code into the window that appears. It
will put the date next to any text entry in column B - the code uses the change event, so it will
work when you enter a value into a single cell in column B.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myDbl As Double
If Target.Cells.Count 1 Then Exit Sub
If Target.Column < 2 Then Exit Sub
On Error GoTo StringEntry
myDbl = CDbl(Target.Value)
GoTo notString
StringEntry:
Application.EnableEvents = False
With Cells(Target.Row, Target.Column + 1)
.Value = Date
.NumberFormat = "mmm dd, yyyy"
End With
Application.EnableEvents = True
Exit Sub
notString:
End Sub

HTH,
Bernie
MS Excel MVP


"Sara Wiseman" <Sara wrote in message
...
If I want a cell to check to see if another cell has text in it, and then if
it does have text then it enters the date, what formula would I use? I have
part of it figured out:

=IF(ISTEXT(B2), "", "")

What I am missing is: =IF(ISTEXT(B2), "how do I get it to enter the date
here?", "")

I cannot figure out what goes inbetween the fist set of " to get it to enter
today's date. Please help me if possible, I'm going NUTS!. Thank you.

Sara





All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com