+ Reply to Thread
Results 1 to 2 of 2

New to macros! Need Help!

Hybrid View

  1. #1
    Asian Mike
    Guest

    New to macros! Need Help!

    I want to create a macro that will read in a range of cells (ex: i2 - as2)
    and then look at each value in the cells. If that value matches a certain
    value I would like it to print out a certain phrase. But if it doesn't then I
    would like it to not do anything and just move on until it finds the equal
    value. Look through a row to find a value and for each case found, print out
    a phrase in column.

    Example:
    If you have table,
    x y z
    a 1 1 1
    b 0 0 1
    c 1 1 0

    abc are names while xyz and certain topics. if a has a 1 value for any of
    the xyz i want it to print out something like:
    a x
    y
    z

    b z

    c x
    y

    If I'm not making clear just let me know and I'll try to clarify. Also
    remember that I'm new to macros so I might need some additional guidance.

  2. #2
    CLR
    Guest

    RE: New to macros! Need Help!

    Well, assumning you don't really want the results to be "vertical" but rather
    just XYZ in one cell.........then with your first 1 starting in B2, you could
    put this formula in E2, and copy it down column E and you don't need a
    macro.......

    =IF(B2=1,"X","")&IF(C2=1,"Y","")&IF(D2=1,"Z","")

    Vaya con Dios,
    Chuck, CABGx3



    "Asian Mike" wrote:

    > I want to create a macro that will read in a range of cells (ex: i2 - as2)
    > and then look at each value in the cells. If that value matches a certain
    > value I would like it to print out a certain phrase. But if it doesn't then I
    > would like it to not do anything and just move on until it finds the equal
    > value. Look through a row to find a value and for each case found, print out
    > a phrase in column.
    >
    > Example:
    > If you have table,
    > x y z
    > a 1 1 1
    > b 0 0 1
    > c 1 1 0
    >
    > abc are names while xyz and certain topics. if a has a 1 value for any of
    > the xyz i want it to print out something like:
    > a x
    > y
    > z
    >
    > b z
    >
    > c x
    > y
    >
    > If I'm not making clear just let me know and I'll try to clarify. Also
    > remember that I'm new to macros so I might need some additional guidance.


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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