Macro to add text in Cell (in a range of Row)

  • Thread starter Thread starter herve
  • Start date Start date
H

herve

Hello,
in sheet1, I would like to add text in cells in Column C from a rang
of row (by FirstRow to LastRow.

In Cell C11 to C?? (LastRow) i would like to add "U-".
does anyone could help me to perform this ?
Thanks in advance.
Herv
 
Hi Herve,

I assume that your intention is to add "U-" as a prefix to existing text.

Try:
'============>>
Public Sub Tester()
Dim LCell As Range
Dim rng As Range
Dim rCell As Range

Set LCell = Cells(Rows.Count, "C").End(xlUp)
Set rng = Range("C11", LCell)

For Each rCell In rng.Cells
rCell.Value = "U-" & rCell.Value
Next rCell
End Sub
'<<============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top