Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I think you could use a column of helper cells:
=substitute(a1,":61",":59") (and dragdown) Then edit|copy and edit|Paste special|Values over the original range (then delete that column of helper cells) Or you could select the range and then run a macro: Option Explicit Sub testme() Dim myCell As Range Dim myRng As Range Dim fStr As String Dim tStr As String fStr = ":59" tStr = ":61" Set myRng = Nothing On Error Resume Next Set myRng = Intersect(Selection, _ Selection.Cells.SpecialCells _ (xlCellTypeConstants, xlTextValues)).Cells On Error GoTo 0 If myRng Is Nothing Then MsgBox "Please select some cells with values!" Exit Sub End If For Each myCell In myRng.Cells With myCell .Value = Application.Substitute(.Value, fStr, tStr) End With Next myCell End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Sam wrote: Hello, I have a long column of numbers [dates in the YY:DD format]. I wanted to replace ":61" to ":59". Even though the cells are initially formatted as Text, as soon as I make the change, Excel changes the formatting to Time, and the cell with the change now has text ":59:00" in it. Is it possible to force Excel to keep the cells formatted as Text? Thank you! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting Columns in Excel | Excel Discussion (Misc queries) | |||
Excel conditional formatting error | Excel Discussion (Misc queries) | |||
How do I automatically send daily email of updated Excel workbook. | Excel Discussion (Misc queries) | |||
Excel shifts to wrong worksheet automatically | Excel Worksheet Functions | |||
pasting into an excel template without losing the formatting | Excel Discussion (Misc queries) |