none
VBA Coding in Excel RRS feed

  • Question

  • I need some help writing a Sub function in an excel module. Here's the dilema:

     

    I have a workbook (.xls) that has two worksheets labeled "Ledger" and "Acronyms."

     

    The "Ledger" worksheet, Column A, requires user inputs that are acronyms.

    The "Ledger" worksheet, Column B, should be automatically filled in with the definition of the acronym.

     

    The "Acronyms" worksheet, Column A, has a list of all possible acronyms that can be input into the "Ledger" worksheet.

    The "Acronyms" worksheet, Column B, has a a list of all the respective definitions for each acronym.

     

    The code I am trying to write should use the input from the "Ledger" worksheet to lookup the corresponding definition from the "Acronyms" worksheet.

     

    I realize that the VLOOKUP function will most likely be used, and have used it already as a function within the cells on the "Ledger" worksheet, but have come across the following problems:

     

    1. When the data is sorted, the values in Column B no longer correspond to the neighboring acronym in Column A. The cell references its previous location before it was sorted.

     

    2. I have to drag highlite and drag the last entry in the column to be able to get new entries to follow the same "format." If I drag the formatting in advance, then Excel believes these cells are in use and when I print I get multiple blank sheets of paper printing.

     

    I have tried several attempts to write the Sub script myself, but have been unsucessful since I'm very new to the VBA syntax and language.

     

    Thanks in advance for any help,

     

     

    Tuesday, January 29, 2008 5:28 PM

All replies