UMAKEMESIK
Active Member
- Joined
- Oct 3, 2005
- Messages
- 378
I am reposting an old post in which I tried to use but does not work
am I doing something wrong.
below is the original post:
-----------------------
Here is a Vba solution:
If you will be entering all your values in column "A" for example use this:
Put a list of your shortened values like "Ja" for January into column "E" starting in row(1) and as far down as you like.
And in column "F" adjacent to "Ja" put the full value like "January"
Now any time you enter "Ja" in column "A" the value will be changed to "January"
You can modify this script to include columns A to C or what ever you want. And you can modify the columns with your shortened and full text values if you want.
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
on my wb in inserted a module1
and put this in there.
you will see on my frst sheet the rage is column b for the entry
and on my sheet I enter items in B2
I put the abbreviated list in p starting In p2
and the full name list in Q starting in Q2
and nothing happens.
anyhelp would be appreciated.
am I doing something wrong.
below is the original post:
-----------------------
Here is a Vba solution:
If you will be entering all your values in column "A" for example use this:
Put a list of your shortened values like "Ja" for January into column "E" starting in row(1) and as far down as you like.
And in column "F" adjacent to "Ja" put the full value like "January"
Now any time you enter "Ja" in column "A" the value will be changed to "January"
You can modify this script to include columns A to C or what ever you want. And you can modify the columns with your shortened and full text values if you want.
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Application.EnableEvents = False
Dim c As Range
For Each c In Range("E1:E" & Cells(Rows.Count, "E").End(xlUp).Row)
If c.Value = Target.Value Then Target.Value = c.Offset(0, 1).Value
Next
End If
Application.EnableEvents = True
End Sub
on my wb in inserted a module1
and put this in there.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B:B")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Application.EnableEvents = False
Dim c As Range
For Each c In Range("P1:P" & Cells(Rows.Count, "P").End(xlUp).Row)
If c.Value = Target.Value Then Target.Value = c.Offset(0, 1).Value
Next
End If
Application.EnableEvents = True
End Sub
you will see on my frst sheet the rage is column b for the entry
and on my sheet I enter items in B2
I put the abbreviated list in p starting In p2
and the full name list in Q starting in Q2
and nothing happens.
anyhelp would be appreciated.