Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default use VBA color the cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default use VBA color the cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default use VBA color the cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default use VBA color the cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default use VBA color the cells

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to color automatically color code sums in cells kuroitenpi Charts and Charting in Excel 1 November 29th 06 03:16 AM
How do I apply color in cells ..color now shown only in print prev bonadimi Excel Worksheet Functions 1 April 25th 06 07:34 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
Excel 2003 will not display color fonts or color fill cells DaveC Excel Worksheet Functions 1 April 11th 05 04:38 PM
My excel 2003 wont let me fill cells with color or color the tabs. trizog New Users to Excel 2 February 22nd 05 06:43 PM


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"