Thread: Remove h
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
B Lynn B B Lynn B is offline
external usenet poster
 
Posts: 131
Default Remove h

you could do this with formulas, but since you're asking in the excel
programming group, here's some code that will do it. This has user manually
select the cells they want it to work on. But you could just as easily
define a set range...

Sub StripRightH()

For Each cell In Selection.Cells
If cell < "" And UCase(Right(cell, 1)) = "H" Then _
cell.Value = Left(cell, Len(cell) - 1)
Next cell

End Sub


"C" wrote:

My spreadsheet has 7 Columns of data..A:G. I have monthly sales numbers to
the right of that with the month headers starting in H4. The monthly numbers
will have a trailing h with them. The monthly columns may be H6:N50 or H6 to
JA 5000. The numbers in H6:...could be one diget to 10 digets. Is there any
way to go through this and eliminate the h?

thanks in advance,

CB