CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    1

    Excel - VBA help

    Hey everyone, new to these forums. I'm lookin for a little help. I am not familiar with VB, as I'm usually using C++. I am needing to create a new function in Excel since I cannot seem to find one that's already made. I am not sure how to make it. Basically what I'm looking for is a function that will display text in the cell, but have a numerical value. For instance, the function declaration may look something like this:

    define(text_to_display, numerical_value)

    I want this for a project I'm doing. For instance, lets say I want cell A1 to display the letter 'A', but I want it to have a numerical value of 4. So that way if I had A1 to another cell, lets say A2, which is 5, then I will get the answer 9. Not the Excel error #VALUE! I'm going to have a column of letters, each letter having a numerical value but displaying a letter, and when I sum that column, it will add their numerical values.

    I am unsure how to create the body of the function as I'm, like I said, very new to VB. If anyone can help me I would really appreciate it. Thanks.

  2. #2
    Join Date
    Sep 2004
    Location
    Sandhem, Sweden
    Posts
    20

    Re: Excel - VBA help

    Hi.

    Maybe I'm on the wrong path, but, can't you just but the letters in, for example, column A and each letter's value in column B. Then just hide the B column.
    That way you can get the sum by putting '=B1+B10', if you have 10 rows, in a cell somewhere.

    Please explain a bit more then maybe I can help you.

    Regards,
    Michael

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured