rss
twitter
  •  

Excel : Convert a Currency Number into Words

| Posted in MS Office, Tips and Tricks, Windows |

0

Here is a very popular bit of code from Microsoft that will convert any currency amount in a cell to English words. All code and text from below here is the work of Microsoft.

Summary
This article shows you how to create a sample, user-defined function named Numbers2Words() to convert a numeric value to an English word representation. For example, the function will return the following words for the number

1234.56 :  Rupees One Thousand Two Hundred Thirty Four and Fifty Six Paisa Only

How to create the sample function Called Numbers2Words()

  1. Start Microsoft Excel.
  2. Press ALT+F11 to start the Visual Basic Editor.
  3. On the Insert menu, click Module.
  4. Type the following code into the module sheet and Save.

----------------------------------------------------------------------------------------------------------------------

Option Explicit
'Main Function
Function Numbers2Words(ByVal MyNumber)
Dim Rupees, Paisa, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert Paisa and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Paisa = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Rupees
Case ""
Rupees = "No Rupees"
Case "One"
Rupees = "One Rupees"
Case Else
Rupees = "Rupees " & Rupees
End Select
Select Case Paisa
Case ""
Paisa = " and No Paisa"
Case "One"
Paisa = " and One Paisa"
Case Else
Paisa = " and " & Paisa & " Paisa"
End Select
Numbers2Words = Rupees & Paisa & " Only"
End Function
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = ""           ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else                                 ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1))  ' Retrieve ones place.
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function

Option Explicit

'Main Function
Function Numbers2Words(ByVal MyNumber)
    Dim Rupees, Paisa, Temp
    Dim DecimalPlace, Count
    ReDim Place(9) As String
    Place(2) = " Thousand "
    Place(3) = " Million "
    Place(4) = " Billion "
    Place(5) = " Trillion "
    ' String representation of amount.
    MyNumber = Trim(Str(MyNumber))
    ' Position of decimal place 0 if none.
    DecimalPlace = InStr(MyNumber, ".")
    ' Convert Paisa and set MyNumber to dollar amount.
    If DecimalPlace > 0 Then
        Paisa = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
                  "00", 2))
        MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
    End If
    Count = 1
    Do While MyNumber <> ""
        Temp = GetHundreds(Right(MyNumber, 3))
        If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees
        If Len(MyNumber) > 3 Then
            MyNumber = Left(MyNumber, Len(MyNumber) - 3)
        Else
            MyNumber = ""
        End If
        Count = Count + 1
    Loop
    Select Case Rupees
        Case ""
            Rupees = "No Rupees"
        Case "One"
            Rupees = "One Rupees"
         Case Else
            Rupees = "Rupees " & Rupees
    End Select
    Select Case Paisa
        Case ""
            Paisa = " and No Paisa"
        Case "One"
            Paisa = " and One Paisa"
              Case Else
            Paisa = " and " & Paisa & " Paisa"
    End Select
    Numbers2Words = Rupees & Paisa & " Only"
End Function

' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
    Dim Result As String
    If Val(MyNumber) = 0 Then Exit Function
    MyNumber = Right("000" & MyNumber, 3)
    ' Convert the hundreds place.
    If Mid(MyNumber, 1, 1) <> "0" Then
        Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
    End If
    ' Convert the tens and ones place.
    If Mid(MyNumber, 2, 1) <> "0" Then
        Result = Result & GetTens(Mid(MyNumber, 2))
    Else
        Result = Result & GetDigit(Mid(MyNumber, 3))
    End If
    GetHundreds = Result
End Function

' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
    Dim Result As String
    Result = ""           ' Null out the temporary function value.
    If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19...
        Select Case Val(TensText)
            Case 10: Result = "Ten"
            Case 11: Result = "Eleven"
            Case 12: Result = "Twelve"
            Case 13: Result = "Thirteen"
            Case 14: Result = "Fourteen"
            Case 15: Result = "Fifteen"
            Case 16: Result = "Sixteen"
            Case 17: Result = "Seventeen"
            Case 18: Result = "Eighteen"
            Case 19: Result = "Nineteen"
            Case Else
        End Select
    Else                                 ' If value between 20-99...
        Select Case Val(Left(TensText, 1))
            Case 2: Result = "Twenty "
            Case 3: Result = "Thirty "
            Case 4: Result = "Forty "
            Case 5: Result = "Fifty "
            Case 6: Result = "Sixty "
            Case 7: Result = "Seventy "
            Case 8: Result = "Eighty "
            Case 9: Result = "Ninety "
            Case Else
        End Select
        Result = Result & GetDigit _
            (Right(TensText, 1))  ' Retrieve ones place.
    End If
    GetTens = Result
End Function

' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
    Select Case Val(Digit)
        Case 1: GetDigit = "One"
        Case 2: GetDigit = "Two"
        Case 3: GetDigit = "Three"
        Case 4: GetDigit = "Four"
        Case 5: GetDigit = "Five"
        Case 6: GetDigit = "Six"
        Case 7: GetDigit = "Seven"
        Case 8: GetDigit = "Eight"
        Case 9: GetDigit = "Nine"
        Case Else: GetDigit = ""
    End Select
End Function
----------------------------------------------------------------------------------------------------------------------

How to use the Numbers2Words() sample function

Method 1: Direct Entry

You can change 32.50 into "Rupees Thirty Two and Fifty Paisa" by entering the following formula into a cell:

=Numbers2Words(32.50)

Method 2: Cell reference

You can refer to other cells in the workbook. For example, enter the number 32.50 into cell A1, and type the following formula into another cell:

= Numbers2Words(A1)

Method 3: Function Wizard

The Function Wizard can also be used to enter a custom function in a worksheet. To use the Function Wizard, follow these steps:

1. Click the Function Wizard button, and select User Defined under Function Category.

2. Select Numbers2Words, and enter your number or cell reference.

3. Click Finish

Hope you enjoyed these tips,  please share your Favorite Network as follows.

How to Unlock Password Protected Word Documents

| Posted in MS Office, Tips and Tricks, Windows |

7

The following article details the steps for removing Microsoft Word document passwords using the our recommended download for Office document password removal. These instructions are valid for all versions of Microsoft Office including Office 2007. Note: Use this article if you're looking for Excel password recovery.

Step 1: Install the Word Password Recovery Download

To recover your Word document password, you'll need to first download the Petri-recommended Office Password Recovery Pro utility. The direct download is available here. (2.1Mb)

Run the setup file, using the recommended default install options.

Step 2: Start the Password Recovery Wizard

Use the Open command on the toolbar (or in the application’s file menu) and locate the Word document you’d like to access. This launches the Office Password Recovery wizard. Step 3: Choose to Remove or Retrieve the Password Office Password Recovery gives you two ways of accessing your protected file; completely remove the password protection, or reveal the original password.  Choose the option that best meets your needs:

C-Infosoft Technologies | Professional and High Quality web design in Coimbatore

Recovery Option 1: Delete the Existing Password

Using a web-based tool, the application gathers information about your document’s encryption and determines the ideal configuration needed to remove your password.

Note: This option removes all password encryption on your file and leaves the document completely unlocked until you choose to re-enable password protection.

C-Infosoft Technologies | Professional and High Quality web design in Coimbatore

Once the process completes, you simply specify where to save the decrypted file and hit OK. Success! Office Password Recovery Pro prompts you to view your recovered document.

Recovery Option 2: Password Retrieval

If it's important for you to know and recover the password used on your file, choose Recover the password to open option.   The wizard then leads you through a short series of questions, aimed at gathering clues about the schema of the password. Answering these questions is not required. If you don’t’ have any clues to go on, simply leave the default selections as they are and press the Next button twice and then click Finish. Office Password Recovery will begin trying millions of combinations to crack the password on your file. This process will continue in the background, using a number of different password attack schemes until it locates a match.

C-Infosoft Technologies | Professional and High Quality web design in Coimbatore

Once your password has been recovered, the program clearly notifies you of its success and the results:

When you have critical Word documents and just can’t find the passwords to open them, we highly recommend you download Office Password Recovery PRO.

Hope you enjoyed these tips,  please share your Favorite Network as follows.

Excel Password Recovery Instructions (.xls)

| Posted in MS Office, Tips and Tricks, Windows |

0

Often when an employee departs, they take important Excel passwords with them. This guide outlines how to use a simple Excel password recovery application to crack lost or forgotten passwords, allowing you to unlock password-encrypted Microsoft Excel documents quickly as possible.

Step 1: Download and Install the Office Password Recovery Utility

To perform the following recovery steps, you'll need to grab the download of Office Password Recovery Pro, available directly here. (2.1Mb)

Once you've downloaded the program, run the install with the default options.

Step 2: Navigate to the Protected File and Begin the Recovery Process

Click the Open button on the top left, navigate to the protected spreadsheet file:

C-Infosoft Technologies | Professional and High Quality web design in Coimbatore

The Open button launches the Recovery Wizard.

The Wizard gives you the option of simply decrypting the spreadsheet (aka. removing the password protection entirely) or displaying the original document password:

C-Infosoft Technologies | Professional and High Quality web design in Coimbatore

Recovery Option 1: 100% Instant Document Decryption

This option is the quickest way to access your file, but strips all password protection from the document, so you'll need to setup password protection on the file again if you want to lock it down in the future.

With this option, the application securely pings the Password Solutions' server to determine the type of encryption used on the file and determines the best decryption method for removing the password from the Excel workbook:

When prompted, choose where you’d like to save the unlocked, decrypted version and hit OK.

Success! The program now offers to automatically open your unlocked document.

Recovery Option 2: 'Recover the Password to Open'

If the document is password-protected and you’d like to recover the original password (perhaps for use in opening other Office documents) select Recover the Password to Open.

You’ll then be asked a couple questions to aid in determining the password schema. These are geared at narrowing the applications search for possible matches, but are not required.

If you don’t have any idea, simply leave all default selections, press the Next button twice and then click Finish.

Office Password Recovery then starts attempting to crack the password using a number of built-in 'attack schemes' and millions of unique password combinations.

Once your password has been recovered, the program clearly notifies you of the results:

C-Infosoft Technologies | Professional and High Quality web design in Coimbatore

Note: Even the passwords on individual sheets within your Excel workbook are recovered, giving you complete access across the entire workbook.

If you’re stuck and just can’t find that password, we highly recommend downloading Office Password Recovery Pro and running through these steps.

Hope you enjoyed these tips,  please share your Favorite Network as follows..

Random Plugin created by Best Accountants Services