If Cell Not Number Than Specific Word?

  • Thread starter Thread starter JK
  • Start date Start date
J

JK

How do I write a procedure that would make the cell value the word "Studio"
if it is not a number (1 or 2 or 3 or 4 or 5)? It would be in the page's
Selection_Change because the cell can be written to from another form also.
Thank you in advance.

Jim Kobzeff
 
Are you sure you want it in the SelectionChange event? It seems
that the Change event would be more appropriate.

Private Sub Worksheet_Change(ByVal Target As Range)
If IsNumeric(Target.Text) = False Then
Application.EnableEvents = False
Target.Value = "Studio"
Application.EnableEvents = True
End If
End Sub




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top