Create a shortcut for repetitive text

D

Deej Hernandez

I have Office 2007 Home Edition running on a laptop with Vista Home Premium.
I run a football pool every season and would like to know if there is any way
to create shortcuts for all of the team names/division so that I don't have
to type all 32 names with division every week. For example right now I have
to completely type Denver (AFC West) for every game during the season and
possible postseason games also. Is there anything I can create to use in
Excel so that I just have to type one or two letters and it will put in the
whole name?
 
G

Gary''s Student

Say we need to enter team names in column A of some worksheet, but we would
like to enter only a two digit numbers and have a translation automatically
be performed. First enter this event macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Team(1 To 32) As String
Team(1) = " Buffalo Bills (AFC-East)"
Team(2) = " Miami Dolphins (AFC-East)"
Team(3) = " New England Patriots (AFC-East)"
Team(4) = " New York Jets (AFC-East)"
Team(5) = " Baltimore Ravens (AFC-North)"
Team(6) = " Cincinnati Bengals (AFC-North)"
Team(7) = " Cleveland Browns (AFC-North)"
Team(8) = " Pittsburgh Steelers (AFC-North)"
Team(9) = " Houston Texans (AFC-South)"
Team(10) = " Indianapolis Colts (AFC-South)"
Team(11) = " Jacksonville Jaguars (AFC-South)"
Team(12) = " Tennessee Titans (AFC-South)"
Team(13) = " Denver Broncos (AFC-West)"
Team(14) = " Kansas City Chiefs (AFC-West)"
Team(15) = " Oakland Raiders (AFC-West)"
Team(16) = " San Diego Chargers (AFC-West)"
Team(17) = " Dallas Cowboys (NFC-East)"
Team(18) = " New York Giants (NFC-East)"
Team(19) = " Philadelphia Eagles (NFC-East)"
Team(20) = " Washington Redskins (NFC-East)"
Team(21) = " Chicago Bears (NFC-North)"
Team(22) = " Detroit Lions (NFC-North)"
Team(23) = " Green Bay Packers (NFC-North)"
Team(24) = " Minnesota Vikings (NFC-North)"
Team(25) = " Atlanta Falcons (NFC-Souch)"
Team(26) = " Carolina Panthers (NFC-Souch)"
Team(27) = " New Orleans Saints (NFC-Souch)"
Team(28) = " Tampa Bay Buccaneers (NFC-Souch)"
Team(29) = " Arizona Cardinals (NFC-West)"
Team(30) = " St. Louis Rams (NFC-West)"
Team(31) = " San Francisco 49'ers (NFC-West)"
Team(32) = " Seattle Seahawks (NFC-West)"
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Application.EnableEvents = False
v = Target.Value
Target.Value = Team(v)
Application.EnableEvents = True
End Sub

If you now type 3 in a cell in column A it will become:

New England Patriots (AFC-East)
 
G

Gary Keramidas

you could set up an autocorrect for each one:

replace nyg with New York Giants (NFC East)

-

Gary Keramidas
Excel 2003
 
D

Dave Peterson

You may want to dump excel completely.

There are tons of sites that do this already. ESPN, Yahoo, ...
 

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

Top