Cell to contain the format of the text entered??

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi,

I have a spreadsheet that requires a user to fill in a (kind of) form.
It's just the first page of a spreadsheet that looks pretty...no check
boxes, toggle buttons or anything of that nature!!

I would like the cell to contain the format of the data that is to be
entered.
i.e in the expiry field (cell) i would like it to have "ddmm" written
in it until a user overwrites it (overwrites is probably the wrong
word, as if the field is left empty I don't want the spreadsheet to
recognise the value as "ddmm" as opposed to "empty")

I have tried a text box beneath, but this still shows when an entry is
made and looks a mess.

If this can be done or anyone has an idea for a workaround please let
me know.

Any help or pointers received are always thankfully accepted.

Paul
 
Hi

One way would be to Insert / Comment. This displays when the cell is
selected or the mouse is moved over it. This leaves a red triangle in a
corner, so you might not like it.
An alternative is to use Data Validation. Select the cell, then
Data/Validation. On the Input Message tab, type ddmm, or 'Please input in
ddmm format' and click on 'Show input message when cell is selected'.

Hope this helps.

Andy.
 
Just to add to Andy B, you might try some code in the worksheet module
(rightclick the sheet tab to access it).

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then
MsgBox "Enter in format 'ddmm'.", 64, "Expiry"
End If
End Sub

Rgds,
Andy
 
You could try this:

Put "ddmm" in your entry cell.
Then paste the code below into the worksheet's code module.
There's no data validation in this.
I've assumed the input cell is G9.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub

If Target.Row <> 9 And Target.Column <> 7 Then Exit Sub

If Target.Value = "" Then Target.Value = "ddmm"

End Su
 

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