Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 8
Thumbs up

Quote:
Originally Posted by Dave Peterson
In your original post, you used a format of dd/mm/yyyy. In this example, you
lost the leading 0's in the day and only used two digit years.

This will work if you really use a format of dd/mm/yyyy. (But remember, you
have to be formatting values--not formulas--formulas can't use this kind of
character by character formatting.)

Option Explicit
Sub testme()
Dim myRng As Range
Dim myCell As Range
Dim iCtr As Long

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 "No constants"
Exit Sub
End If

For Each myCell In myRng.Cells
For iCtr = 1 To Len(myCell.Value)
If Mid(myCell.Value, iCtr, 10) Like "##/##/####" Then
With myCell.Characters(Start:=iCtr, Length:=10).Font
.Name = "Arial"
.Bold = True
.Size = 12
End With
End If
Next iCtr
Next myCell
End Sub
Dave Peterson
Thanks a lot! That worked brilliantly. Much appreaciated.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a number from a string and converting it into an Intege Sumeet Benawra Excel Worksheet Functions 2 May 10th 06 10:07 AM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM
converting number string to number with decimal rortiz Excel Worksheet Functions 2 September 15th 05 08:34 PM
last number array from string Michael Excel Worksheet Functions 17 August 1st 05 07:30 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 12:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"