PC Review


Reply
Thread Tools Rate Thread

distinguishing between cell formula, and the resulting text in cell

 
 
excelnut1954
Guest
Posts: n/a
 
      23rd Jan 2007
Hope I explain this good enough.

Cell A6 has an If-then formula that will show "Send Now" in the cell if
the date in another column matches a certain criteria.

=IF(E7<1,"",IF(E7<=WORKDAY(TODAY(),1,Holidays_2007),"SEND NOW",""))
The cell will show SEND NOW if the criteria matches. Otherwise the cell
will have the formula in it, but will look blank.

I'm trying to write a macro that will recognize when the cell shows
Send Now, as opposed to just the formula. Here's a simplified version
of what I want. This doesn't work, but it shows the concept of what I'm
trying to do.

Range("A6").Select 'cell with the
formula in it
If ActiveCell.Value = "Send Now" Then 'How do I write this line
so that SEND NOW is recognized?
Range("L8").Select
ActiveCell.Value = "Send Now"
End If

I've search Help, and other postings here, but can't find the answer.
If you could help, I'd appreciate it very much.
Thanks,
J.O.

 
Reply With Quote
 
 
 
 
excelnut1954
Guest
Posts: n/a
 
      23rd Jan 2007
I appreciate the help of everyone. GEEZ. I didn't see the upper/lower
case problem. Great suggestions. Also, thanks for showing how to write
the code a little cleaner.
Thanks again.
J.O.
Tom Ogilvy wrote:
> Missed that you were writing to L8
>
> if lcase(Range("A6")).Value = "send now" then
> Range("L8").Value = "Send Now"
> else
> Range("L8").clearcontents
> End if
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "Tom Ogilvy" wrote:
>
> > if lcase(Range("A6")).Value = "send now" then
> > msgbox "Send Now
> > End if
> >
> > Don't set the value of the cell with code, or you will overwrite your
> > formula (unless that is what you want to do).
> >
> > The test for not send now would be
> >
> > if Range("A6").Value = "" then
> >
> > msgbox "don't send now"
> > End if
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> > "excelnut1954" wrote:
> >
> > > Hope I explain this good enough.
> > >
> > > Cell A6 has an If-then formula that will show "Send Now" in the cell if
> > > the date in another column matches a certain criteria.
> > >
> > > =IF(E7<1,"",IF(E7<=WORKDAY(TODAY(),1,Holidays_2007),"SEND NOW",""))
> > > The cell will show SEND NOW if the criteria matches. Otherwise the cell
> > > will have the formula in it, but will look blank.
> > >
> > > I'm trying to write a macro that will recognize when the cell shows
> > > Send Now, as opposed to just the formula. Here's a simplified version
> > > of what I want. This doesn't work, but it shows the concept of what I'm
> > > trying to do.
> > >
> > > Range("A6").Select 'cell with the
> > > formula in it
> > > If ActiveCell.Value = "Send Now" Then 'How do I write this line
> > > so that SEND NOW is recognized?
> > > Range("L8").Select
> > > ActiveCell.Value = "Send Now"
> > > End If
> > >
> > > I've search Help, and other postings here, but can't find the answer.
> > > If you could help, I'd appreciate it very much.
> > > Thanks,
> > > J.O.
> > >
> > >


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula does not display the resulting value in the cell =?Utf-8?B?TGlsaWFuYQ==?= Microsoft Excel New Users 2 19th Jul 2007 08:50 AM
auto change cell text colour resulting from a condition =?Utf-8?B?Q2hpbmFtYW4=?= Microsoft Excel Worksheet Functions 2 14th Dec 2006 01:19 AM
Results no longer currency when adding text to formula / formulas based on resulting cell don't work. StargateFan Microsoft Excel Programming 1 29th Oct 2006 02:00 PM
My formula show up in the cell instead of a resulting value =?Utf-8?B?U3dlZXRldGM=?= Microsoft Excel Worksheet Functions 2 26th Jan 2006 11:41 PM
Distinguishing cell formula from value. buczacz Microsoft Excel Programming 2 23rd Sep 2003 07:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 AM.