View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Add a character to all cells in a column

one way
Sub putletterinfront()
For Each c In Range("d2:d9")
If Len(Application.Trim(c)) 1 Then c.Value = "j" & c
Next
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"glenn" wrote in message
...
Hi all

how would i go in VBA to do this:

I have a single worksheet and i have a column with heading COLOR. I do not
know what position color has in my worksheet (it could be column B, C or
any other).

I want to prepend a character "j" to all cells in the column that have a
value.

So if my column initially is like:

COLOR
==========
yellow
pink
orange


after i run the VBA script

it should be

COLOR
==========
jyellow
jpink
jorange





thank you!