Msgbox if cell contains text

Dobbo

New Member
Joined
Apr 2, 2002
Messages
12
If cell F3 contains text I want a message box run, I can do this with a number but having problems if cell contains text.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Not quite what I meant, cell F3 could contain any text not "text" the word. Basically if cell F3 contains any word I want a message box to run.
 
Upvote 0
Here you go:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Worksheets("sheet1").Range("f3").Value = "" Then
Exit Sub
Else
MsgBox ("An entry has been made")
End If

End Sub

Audiojoe
This message was edited by Audiojoe on 2002-04-24 02:42
 
Upvote 0
Many Thanks sorted out the problem now. I had the extra problem that F3 cell was merged with G3 & H3 so I had to call the range as well.

Works perfectly now Thank you
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,937
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top