FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,368
- Office Version
- 365
- 2016
- Platform
- Windows
This works well, but curios, can this be done without looping? Such as with Evaluate?
Code:
[FONT="Arial"][COLOR=#000000]SubAddPeriod()[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] Dim c As Range[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] For Each c In Range("C8",Range("C" & Rows.Count).End(xlUp))[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] If PeriodExists(c) <> True Then[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] If Len(c) > 0 And Right(c, 1)<> "." Then c = c & "."[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] End If[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] Next c[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000]EndSub[/COLOR][/FONT]
Code:
[FONT="Arial"][COLOR=#000000]FunctionPeriodExists(ByVal Rng As Range) As Boolean[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] If InStr(Rng.Value, ".") Then[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] PeriodExists = True[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000] End If[/COLOR][/FONT]
[FONT="Arial"][COLOR=#000000]EndFunction[/COLOR][/FONT]
Last edited: