![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
I'm sure this must have been asked before but I've done a quick search of the forum and couldn't find what I wanted. I need the code for finding out if cell A1 contains a "Y" and if it does then insert a chart. I have the code for inserting a chart but not too sure on the code for checking if "A1" contains "Y" and if it does how to link it to the add chart code. Hope this makes sense and someone can help.
thanks Matt |
|
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
can't help with code, but is this any help? =IF(ISERROR(SEARCH("y",A1)),FALSE,TRUE) will return TRUE if there's a y in the target cell and FALSE if there isn't.
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Hi Matt
You could try something like this: If Range("A1").Value = "Y" Then Application.Run "name of your chart macro" End Sub (this is case sensitive) hope this helps regards Derek |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
Thanks for your help guys!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|