How to add a letter to an existing cell with a number?

singlefin

New Member
Joined
Oct 2, 2006
Messages
8
Hi,

I want to add a letter (any letter) to cells in my worksheets that have manually entered numbers, which I have been able to highlight with the following code.

But I want to add a letter in front of whatever number that is in a particular cell. e.g. Cell AA3 has a manually entered value of 5, but I want to add an "R" in front of it to return R5.

Can someone help to modify the code I have below to append the letter but still keep the color highlight for visual reference?

Thanks in advance!


Sub ColorAllNumbers()

ActiveSheet.Range("aa3:ax328,bz3:ct328").SpecialCells _
(xlCellTypeConstants).Interior.ColorIndex = 4

End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Code:
Sub ColorAllNumbers()
Dim Tcell As Range

For Each Tcell In Range("a3:a328,bz3:ct328").SpecialCells(xlCellTypeConstants)
        Tcell.Interior.ColorIndex = 4
        Tcell.Value = "R" & Tcell.Value
Next Tcell
 
Upvote 0
Sub CheckCellVal()
'Sheet Module Code, like: Sheet1.
Dim myRng As Range
Dim Cell As Object

Set myRng = ActiveSheet.Range("AA3:AX328","BZ3:CT328")

For Each Cell In myRng

If Application.WorksheetFunction.IsNumber(Cell.Value) = True Then

Cell.Value = "R" & Cell.Value
Cell.Interior.ColorIndex = 4
End If
Next Cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,431
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top