Results 1 to 11 of 11

Roman Numeral to Decimal converted Using Two ARRAYS

Threaded View

cdesantis01 Roman Numeral to Decimal... 04-15-2014, 10:38 PM
AlphaFrog Re: Roman Numeral to Decimal... 04-15-2014, 11:35 PM
tom.hogan Re: Roman Numeral to Decimal... 04-16-2014, 08:40 AM
cdesantis01 Re: Roman Numeral to Decimal... 04-16-2014, 08:24 PM
tom.hogan Re: Roman Numeral to Decimal... 04-17-2014, 09:51 AM
AlphaFrog Re: Roman Numeral to Decimal... 04-17-2014, 11:03 AM
martindwilson Re: Roman Numeral to Decimal... 04-17-2014, 11:10 AM
AlphaFrog Re: Roman Numeral to Decimal... 04-17-2014, 11:25 AM
cdesantis01 Re: Roman Numeral to Decimal... 04-17-2014, 01:04 PM
tom.hogan Re: Roman Numeral to Decimal... 04-17-2014, 01:25 PM
tom.hogan Re: Roman Numeral to Decimal... 04-19-2014, 03:12 PM
  1. #1
    Registered User
    Join Date
    03-09-2014
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    15

    Roman Numeral to Decimal converted Using Two ARRAYS

    Hi, I have to convert a Roman numerals to decimal numbers using two arrays, L() and D()... I need to take apart the numeral and then store it in an L() array cell, convert it, then store it in a D() array cell. Of course, I need to account for the fact that you need to subtract the numerals that are worth less than the one to the right of it. I assume you would just use If, Then statements for that. But I'm not sure what my professor means by, "take the numeral apart", or how to do it... Anyway, here's what I have so far, any help is much appreciated.

    Sub RomToArab()
    Dim L(1 To 100) As String, D(1 To 100) As Single, rome As String, romelength As Single, Sum As Single
    Dim M, D, C, L, X, V, I As String
    
    rome = UCase(InputBox("Enter your Roman Numeral: "))
    romelength = Len(rome)
    
    For I = 1 To romelength
        Sum = 0
        
     Select Case L(I)
        Case "I"
            Sum = Sum + 1
        Case "V"
            Sum = Sum + 5
        Case "X"
            Sum = Sum + 10
        Case "L"
            Sum = Sum + 50
        Case "C"
            Sum = Sum + 100
        Case "D"
            Sum = Sum + 500
        Case "M"
            Sum = Sum + 1000
     End Select
     
    
     
    Next I
    
        
    
    End Sub
    Last edited by cdesantis01; 04-15-2014 at 10:50 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 09-01-2012, 05:50 PM
  2. Is it possible to get a ROMAN NUMERAL FORMAT when entering in a cell?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-09-2011, 02:46 PM
  3. hh:mm converted to decimal in same cell
    By Gair48 in forum Excel General
    Replies: 3
    Last Post: 04-21-2011, 06:02 AM
  4. Roman Numeral page numbers
    By dbutcher in forum Excel General
    Replies: 2
    Last Post: 01-18-2011, 08:03 PM
  5. Replies: 0
    Last Post: 05-16-2005, 11:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1