ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change color of moved cell text (https://www.excelbanter.com/excel-programming/375862-change-color-moved-cell-text.html)

ploddinggaltn

Change color of moved cell text
 
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

bobbo

Change color of moved cell text
 
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



Bob Phillips

Change color of moved cell text
 
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" wrote in message
...
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





All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com