Resources
  • Home
  • December-Chrono
  • Psalm136Personalized
  • ExcelResources
    • 99PublicFunctions
    • aDelimitedCodeTemplate
    • aCodeTemplate
    • aBetter_Code_Template
    • ApplyFormulaValue
    • ArrayPublic
    • ArrayMatchCopyRow
    • Capitalization
    • Colors
    • DataTypes
    • DeleteRows
    • Filter
    • FormatStandard
    • Forms
    • Grid
    • Headers
    • ImageScrape
    • InputBox
  • ExcelResources2
    • Like
    • List Review
    • MatchAndReturn
    • mod_Import
    • Numbers
    • PDF_Parse
    • RandomGenerator
    • iRe1
    • Rept
    • RelatedItemsLIst
    • RomanNumerals
    • SheetSplitter
    • Sort
    • Split Method
    • String_DataType
    • TabDelimited
    • Tab_InsertNew_or_ClearExisting
    • Unique_List
      • UniqueLIsts_FilterMethod
  • Excelresources_Files
    • FileLists
    • FileTextParse
    • Folders
  • excelresources_WebScrape
    • CreateList_1-Href_2-Jpg
    • TableData_Load_PlugPlay
    • CreateList_MultiPage_Image_Link
      • ImageDownload_WebLink_List
    • TableData_Load_ClassDiv
    • TableData_Load_ClassSpan
  • Houseboat Vacation
  • At the Foot of the King
  • Devotions
  • Mentoring
  • Inspirational Stories
    • Vacuum Lifting
  • Job Help
  • Resources
    • MS
    • Florida History
  • Contact
  • Heroscape
    • Fish
    • Playstation
  • You Tube Videos
  • House
    • Tiny Houses
    • Backyards
  • CampingResources
    • CampingLand
    • LED Throwies
  • Interesting
  • Recipes
  • Xbox
  • Skydiving
  • ReadingPlan-5Year
  • Desoto
  • BibleStudy
  • HurricaneIrma
  • Home
  • December-Chrono
  • Psalm136Personalized
  • ExcelResources
    • 99PublicFunctions
    • aDelimitedCodeTemplate
    • aCodeTemplate
    • aBetter_Code_Template
    • ApplyFormulaValue
    • ArrayPublic
    • ArrayMatchCopyRow
    • Capitalization
    • Colors
    • DataTypes
    • DeleteRows
    • Filter
    • FormatStandard
    • Forms
    • Grid
    • Headers
    • ImageScrape
    • InputBox
  • ExcelResources2
    • Like
    • List Review
    • MatchAndReturn
    • mod_Import
    • Numbers
    • PDF_Parse
    • RandomGenerator
    • iRe1
    • Rept
    • RelatedItemsLIst
    • RomanNumerals
    • SheetSplitter
    • Sort
    • Split Method
    • String_DataType
    • TabDelimited
    • Tab_InsertNew_or_ClearExisting
    • Unique_List
      • UniqueLIsts_FilterMethod
  • Excelresources_Files
    • FileLists
    • FileTextParse
    • Folders
  • excelresources_WebScrape
    • CreateList_1-Href_2-Jpg
    • TableData_Load_PlugPlay
    • CreateList_MultiPage_Image_Link
      • ImageDownload_WebLink_List
    • TableData_Load_ClassDiv
    • TableData_Load_ClassSpan
  • Houseboat Vacation
  • At the Foot of the King
  • Devotions
  • Mentoring
  • Inspirational Stories
    • Vacuum Lifting
  • Job Help
  • Resources
    • MS
    • Florida History
  • Contact
  • Heroscape
    • Fish
    • Playstation
  • You Tube Videos
  • House
    • Tiny Houses
    • Backyards
  • CampingResources
    • CampingLand
    • LED Throwies
  • Interesting
  • Recipes
  • Xbox
  • Skydiving
  • ReadingPlan-5Year
  • Desoto
  • BibleStudy
  • HurricaneIrma
Connect on Facebook

Roman Numerals
Ucase / Proper

Handle Capitalization for Roman Numerals

Function ConvertRomanNumerals(myString As Variant) As String
Dim sTemp As String, aSplitMe As Variant, iLoop As Long, sChunk As String, sReassemble As String, sReduce As String
'----------------------------------------------------------------------------------------------------------------------------
'Convert to String Type and change to Proper Case
sTemp = StrConv(myString, vbProperCase)
'----------------------------------------------------------------------------------------------------------------------------
'Check to see if the characters [i] or [v] exist in the string - skip the conversion process if they dont:
If InStr(1, sTemp, "i", vbTextCompare) > 0 Then GoTo gRomanNumeralCharFoundProcessString
If InStr(1, sTemp, "v", vbTextCompare) > 0 Then GoTo gRomanNumeralCharFoundProcessString

'If it hasn't skipped the process, go to the Review process
GoTo gFinishedProcessingSoReturnResults
'----------------------------------------------------------------------------------------------------------------------------
gRomanNumeralCharFoundProcessString:
'Create a splitter to handle each chunk of the string
aSplitMe = Split(sTemp, " ")

'Loop through each chunk of the string
For iLoop = LBound(aSplitMe) To UBound(aSplitMe)
sChunk = aSplitMe(iLoop)
If InStr(1, sChunk, "i", vbTextCompare) > 0 Then GoTo gProcessThisChunk
If InStr(1, sChunk, "v", vbTextCompare) > 0 Then GoTo gProcessThisChunk
GoTo SkipLoopNotReviewable

gProcessThisChunk:
If Len(sChunk) > 7 Then GoTo SkipLoopNotReviewable

'Remove the I's and V's, then check the length - only change to upper case if the string has been reduced to nothing.
sReduce = Replace(sChunk, "i", "", , , vbTextCompare)
sReduce = Replace(sReduce, "v", "", , , vbTextCompare)
If Len(sReduce) > 0 Then GoTo SkipLoopNotReviewable

'If it got this far, the only characters in the string are V's and I's and it needs to be changed to upper case!!!
sChunk = UCase(sChunk)

SkipLoopNotReviewable:
sReassemble = sReassemble & " " & sChunk
Next iLoop
GoTo gConvertedStringReturnDifferentTempString
'----------------------------------------------------------------------------------------------------------------------------
'Once it gets here, it returns the results
gFinishedProcessingSoReturnResults:
ConvertRomanNumerals = sTemp
GoTo gFixTheWordAnd
Exit Function
'----------------------------------------------------------------------------------------------------------------------------
gConvertedStringReturnDifferentTempString:
ConvertRomanNumerals = Trim(sReassemble)
GoTo gFixTheWordAnd
Exit Function

gFixTheWordAnd:
ConvertRomanNumerals = Replace(ConvertRomanNumerals, " and ", " and ", , , vbTextCompare)
End Function
Powered by Create your own unique website with customizable templates.
  • Home
  • December-Chrono
  • Psalm136Personalized
  • ExcelResources
    • 99PublicFunctions
    • aDelimitedCodeTemplate
    • aCodeTemplate
    • aBetter_Code_Template
    • ApplyFormulaValue
    • ArrayPublic
    • ArrayMatchCopyRow
    • Capitalization
    • Colors
    • DataTypes
    • DeleteRows
    • Filter
    • FormatStandard
    • Forms
    • Grid
    • Headers
    • ImageScrape
    • InputBox
  • ExcelResources2
    • Like
    • List Review
    • MatchAndReturn
    • mod_Import
    • Numbers
    • PDF_Parse
    • RandomGenerator
    • iRe1
    • Rept
    • RelatedItemsLIst
    • RomanNumerals
    • SheetSplitter
    • Sort
    • Split Method
    • String_DataType
    • TabDelimited
    • Tab_InsertNew_or_ClearExisting
    • Unique_List
      • UniqueLIsts_FilterMethod
  • Excelresources_Files
    • FileLists
    • FileTextParse
    • Folders
  • excelresources_WebScrape
    • CreateList_1-Href_2-Jpg
    • TableData_Load_PlugPlay
    • CreateList_MultiPage_Image_Link
      • ImageDownload_WebLink_List
    • TableData_Load_ClassDiv
    • TableData_Load_ClassSpan
  • Houseboat Vacation
  • At the Foot of the King
  • Devotions
  • Mentoring
  • Inspirational Stories
    • Vacuum Lifting
  • Job Help
  • Resources
    • MS
    • Florida History
  • Contact
  • Heroscape
    • Fish
    • Playstation
  • You Tube Videos
  • House
    • Tiny Houses
    • Backyards
  • CampingResources
    • CampingLand
    • LED Throwies
  • Interesting
  • Recipes
  • Xbox
  • Skydiving
  • ReadingPlan-5Year
  • Desoto
  • BibleStudy
  • HurricaneIrma