Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like a macro that if a cell in a column (for
example, column B) contains more than 11 characters, to add an "M" to the contents of the cell. Is this possible? Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Public Sub AddM() Dim rCell As Range For Each rCell in Range("B1:B" & _ Range("B" & Rows.Count).End(xlUp).Row) If Len(rCell.Text) 11 Then _ rCell.Value = rCell.Text & "M" Next rCell End Sub In article , "Janna" wrote: I would like a macro that if a cell in a column (for example, column B) contains more than 11 characters, to add an "M" to the contents of the cell. Is this possible? Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect--Just what I needed. Thanks!
-----Original Message----- One way: Public Sub AddM() Dim rCell As Range For Each rCell in Range("B1:B" & _ Range("B" & Rows.Count).End(xlUp).Row) If Len(rCell.Text) 11 Then _ rCell.Value = rCell.Text & "M" Next rCell End Sub In article , "Janna" wrote: I would like a macro that if a cell in a column (for example, column B) contains more than 11 characters, to add an "M" to the contents of the cell. Is this possible? Thanks in advance. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert character at beginning of cell without changing contents | Excel Discussion (Misc queries) | |||
if alpha character | Excel Discussion (Misc queries) | |||
Prevent alpha character in numeric cell | Excel Discussion (Misc queries) | |||
Parsing a alpha character out of a cell | Excel Worksheet Functions | |||
Increment Alpha Character | Excel Programming |