Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Asian Mike
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel crashes while opening excel file imbeddied with macros ct2147 Excel Discussion (Misc queries) 0 December 30th 05 09:05 PM
Purge macros Don_S Excel Worksheet Functions 1 August 16th 05 03:51 PM
sharing macros fabulousk Excel Discussion (Misc queries) 3 March 7th 05 10:05 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM


All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"