PC Review


Reply
Thread Tools Rate Thread

Change color of moved cell text

 
 
=?Utf-8?B?cGxvZGRpbmdnYWx0bg==?=
Guest
Posts: n/a
 
      24th Oct 2006
Hi, I'm using this code to move any text from Col K to Col H. I want only
the text that is moved to Col H to be in red text, but when I use code to
accomplish this, the entire column text is red. Any idea on how I could just
have the text that is moved be red? Thanks

Sub MovePayments()

' Move payments from column K (11) to column H (8)

Application.DisplayAlerts = False

Set rng = Columns(11).SpecialCells(xlConstants)
For Each cell In rng
Cells(cell.Row, "H").Value = cell.Value
Next
rng.ClearContents


End Sub
 
Reply With Quote
 
 
 
 
bobbo
Guest
Posts: n/a
 
      24th Oct 2006
I had success by doing it with your original code adding
Cells(cell.Row, "H").Font.ColorIndex = 3
in the for next loop and going into the options dialog box selecting
edit and disabling the extend lists and formats and formulas.



ploddinggaltn wrote:
> Hi, I'm using this code to move any text from Col K to Col H. I want only
> the text that is moved to Col H to be in red text, but when I use code to
> accomplish this, the entire column text is red. Any idea on how I could just
> have the text that is moved be red? Thanks
>
> Sub MovePayments()
>
> ' Move payments from column K (11) to column H (8)
>
> Application.DisplayAlerts = False
>
> Set rng = Columns(11).SpecialCells(xlConstants)
> For Each cell In rng
> Cells(cell.Row, "H").Value = cell.Value
> Next
> rng.ClearContents
>
>
> End Sub


 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      24th Oct 2006
Sub MovePayments()
' Move payments from column K (11) to column H (8)

Application.DisplayAlerts = False

Set rng = Columns(11).SpecialCells(xlConstants)
For Each cell In rng
Cells(cell.Row, "H").Value = cell.Value
Next
rng.ClearContents
rng.Offset(0, -2).Interior.ColorIndex = 3

End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ploddinggaltn" <(E-Mail Removed)> wrote in message
news:3A02C97F-463E-49B0-95FB-(E-Mail Removed)...
> Hi, I'm using this code to move any text from Col K to Col H. I want only
> the text that is moved to Col H to be in red text, but when I use code to
> accomplish this, the entire column text is red. Any idea on how I could

just
> have the text that is moved be red? Thanks
>
> Sub MovePayments()
>
> ' Move payments from column K (11) to column H (8)
>
> Application.DisplayAlerts = False
>
> Set rng = Columns(11).SpecialCells(xlConstants)
> For Each cell In rng
> Cells(cell.Row, "H").Value = cell.Value
> Next
> rng.ClearContents
>
>
> End Sub



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Text Color in one cell based upon entry in referenced cell Tee Microsoft Excel Misc 3 12th Sep 2008 10:07 PM
Cell text color change resoof@gmail.com Microsoft Excel Programming 1 7th Feb 2007 08:58 PM
Copy text cell & change text color conditionally =?Utf-8?B?bWFueG1hbg==?= Microsoft Excel Programming 2 31st Aug 2006 08:18 PM
Cell text color change =?Utf-8?B?U3RlZmZlbg==?= Microsoft Excel Misc 1 23rd Feb 2005 10:31 PM
Cell color change with the input of color coded text =?Utf-8?B?bmV3YnkgYmx1ZXM=?= Microsoft Excel Misc 1 19th Nov 2004 02:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:41 PM.