ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   formatting a cell to display a word when i enter a reference lette (https://www.excelbanter.com/excel-discussion-misc-queries/146498-formatting-cell-display-word-when-i-enter-reference-lette.html)

megan62685

formatting a cell to display a word when i enter a reference lette
 
I have a very long list of names. I want to create a column that will allow
me to seperate the names into categories: restaurant, store, brand. I want to
format the column to let me enter a letter: r, s , or b, and then the cell
will display: restaurant, store or brand

Gary''s Student

formatting a cell to display a word when i enter a reference lette
 
An example using column A:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then
Exit Sub
End If
Set r = Target
Application.EnableEvents = False
If r.Value = "r" Then r.Value = "restaurant"
If r.Value = "s" Then r.Value = "store"
If r.Value = "b" Then r.Value = "brand"
Application.EnableEvents = True
End Sub

This is worksheet event code and must be entered in the worksheet code area,
not a standard module.
--
Gary''s Student - gsnu200729


"megan62685" wrote:

I have a very long list of names. I want to create a column that will allow
me to seperate the names into categories: restaurant, store, brand. I want to
format the column to let me enter a letter: r, s , or b, and then the cell
will display: restaurant, store or brand


Dave Peterson

formatting a cell to display a word when i enter a reference lette
 
Another couple options.

Create 3 new autocorrect options (tools|Autocorrect options)

r$$ replaced with restaurant
s$$ with store
b$$ with brand

Any unique strings (easy to type) would work.

Be aware that these autocorrect rules are shared in the Office suite. You may
want to get rid of them when you're done.



Or turn on Autocomplete.
Tools|Options|edit tab|check Enable AutoComplete for Cell values

As long as your data is close together (in a single column), it may work nicely
for you.

I'd turn this off as soon as I was done--I find it irritating.

megan62685 wrote:

I have a very long list of names. I want to create a column that will allow
me to seperate the names into categories: restaurant, store, brand. I want to
format the column to let me enter a letter: r, s , or b, and then the cell
will display: restaurant, store or brand


--

Dave Peterson


All times are GMT +1. The time now is 12:22 AM.

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