when Cell A1 is blank

khalil

Board Regular
Joined
Jun 2, 2011
Messages
100
hi all
please help

when cell A1 is Blank i want the same cell A1= certain text

thanks in advance
:)
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
yes

let me ex-plane more

cell A1 i want to enter in it a text then when i want to delete the entry i want the cell to be converted to a preset text automatically it was originally in it
thanks in advance
 
Upvote 0
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A1" Then
    If Target.Value = "" Then
        Application.EnableEvents = False
        Application.Undo
        Application.EnableEvents = True
    End If
End If
End Sub
 
Upvote 0
we are close her

what happened after using this is

when i printed a text and delete it the cell stuck with the same text

what i want is when i delete the printed text and delete it, the cell goes back to a preset text.:)

since you are so good in this let me ask you another thing if you please;

when i print a text in cell B1 i want cell A1 takes todays date then when tomorrow comes i want to keep that date in the cell not todays date when tomorrow comes

thank you very much
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A1" Then
    If Target.Value = "" Then
        Application.EnableEvents = False
        Target.Value = "Student"
        Application.EnableEvents = True
    End If
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

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