Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi, it's working great!
Thanks allot! "Dave Peterson" wrote: I would still limit my changes to cells in the selection that are not formulas and non-numeric: Option Explicit Sub testme() Dim myRng As Range Dim myCell As Range Set myRng = Nothing On Error Resume Next Set myRng = Intersect(Selection, _ Selection.Cells.SpecialCells(xlCellTypeConstants, xlTextValues)) On Error GoTo 0 If myRng Is Nothing Then MsgBox "Please select a range with text values" Exit Sub End If For Each myCell In myRng.Cells With myCell .Value = .Value & " (anul)" .Characters(Start:=Len(.Value) - 5, Length:=6).Font.ColorIndex = 3 End With Next myCell End Sub puiuluipui wrote: It's working! But i forgot to say that i need "(anul)" to be red. Can the text that i need to appear "(anul)", be red? Thanks allot! "Dave Peterson" a scris: Option Explicit Sub testme() Dim myRng As Range Dim myCell As Range Set myRng = Nothing On Error Resume Next Set myRng = Intersect(Selection, _ Selection.Cells.SpecialCells(xlCellTypeConstants, xlTextValues)) On Error GoTo 0 If myRng Is Nothing Then MsgBox "Please select a range with text values" Exit Sub End If For Each myCell In myRng.Cells With myCell .Value = .Value & " (anul)" End With Next myCell End Sub puiuluipui wrote: Hi, i need to add some text to some cells, but i need a macro linked to a button to do this. If i select a cell and than i click the macro button, then "(anul)" to appear in that cell, at the end of the text. ex:-without button a John C John C (ed) Ex:-with button a John C (anul) John C (ed) (anul) Can this be done? Thanks! -- Dave Peterson -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro - Fixed text code needs replacing with variable text | Excel Discussion (Misc queries) | |||
Macro - Inserting text to a cell already containg text | Excel Worksheet Functions | |||
Macro - Inserting text to a cell already containg text | Excel Discussion (Misc queries) | |||
Need a macro to insert text in a cell that already has text.Excel | Excel Discussion (Misc queries) | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) |