Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have an excel file, user enters numbers or letters. I like to have a macro to color all the cells with the letter "U" at the end. Please help. Thanks so much, Sarah |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
Sub colorifU() For Each c In Selection If UCase(Right(c, 1)) = "U" Then c.Interior.ColorIndex = 6 Next c End Sub -- Don Guillett SalesAid Software "Sarah" wrote in message ... Hi, I have an excel file, user enters numbers or letters. I like to have a macro to color all the cells with the letter "U" at the end. Please help. Thanks so much, Sarah |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Don,
Thanks for your quick response. I'm new to vba, can you give me the full sample code, I don't quite follow it. Thanks, Sarah "Don Guillett" wrote in message ... try Sub colorifU() For Each c In Selection If UCase(Right(c, 1)) = "U" Then c.Interior.ColorIndex = 6 Next c End Sub -- Don Guillett SalesAid Software "Sarah" wrote in message ... Hi, I have an excel file, user enters numbers or letters. I like to have a macro to color all the cells with the letter "U" at the end. Please help. Thanks so much, Sarah |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Don,
Please ignore my message, I figured it out, Thanks again "Don Guillett" wrote in message ... try Sub colorifU() For Each c In Selection If UCase(Right(c, 1)) = "U" Then c.Interior.ColorIndex = 6 Next c End Sub -- Don Guillett SalesAid Software "Sarah" wrote in message ... Hi, I have an excel file, user enters numbers or letters. I like to have a macro to color all the cells with the letter "U" at the end. Please help. Thanks so much, Sarah |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is it. Go to the VBIDE (ALt-F11), open a code module (InsertModule),
and copy the code in. Then in Excel, select your data and run the macro (ToolsMacroMacros..., select ColorifU and hit Run). -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Sarah" wrote in message ... Hi Don, Thanks for your quick response. I'm new to vba, can you give me the full sample code, I don't quite follow it. Thanks, Sarah "Don Guillett" wrote in message ... try Sub colorifU() For Each c In Selection If UCase(Right(c, 1)) = "U" Then c.Interior.ColorIndex = 6 Next c End Sub -- Don Guillett SalesAid Software "Sarah" wrote in message ... Hi, I have an excel file, user enters numbers or letters. I like to have a macro to color all the cells with the letter "U" at the end. Please help. Thanks so much, Sarah |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to color automatically color code sums in cells | Charts and Charting in Excel | |||
How do I apply color in cells ..color now shown only in print prev | Excel Worksheet Functions | |||
change fill color of a range of cells based on color of a cell? | Excel Programming | |||
Excel 2003 will not display color fonts or color fill cells | Excel Worksheet Functions | |||
My excel 2003 wont let me fill cells with color or color the tabs. | New Users to Excel |