Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default USE THE "IF" STATEMENT IN EXCEL

I would like to use an IF statement to program events on an EXCEL spread sheet.
For example, "IF G136 P32 THEN +1.0". Can this be done???
THANKS! RAFAEL DE ECHEANDIA, HAMPTON, VA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default USE THE "IF" STATEMENT IN EXCEL

We are talking about VB code, not worksheet formulas, correct? Can you
provide more detail as to what your example is supposed to be doing (what
kind of events, add 1 to what, etc.)?

--
Rick (MVP - Excel)



"PRECISION SAILOR" <PRECISION wrote in
message ...
I would like to use an IF statement to program events on an EXCEL spread
sheet.
For example, "IF G136 P32 THEN +1.0". Can this be done???
THANKS! RAFAEL DE ECHEANDIA, HAMPTON, VA

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default USE THE "IF" STATEMENT IN EXCEL

Your question is not clear to me. As ALWAYS post your code for comments.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"PRECISION SAILOR" <PRECISION
wrote in
message ...
I would like to use an IF statement to program events on an EXCEL spread
sheet.
For example, "IF G136 P32 THEN +1.0". Can this be done???
THANKS! RAFAEL DE ECHEANDIA, HAMPTON, VA


  #4   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default USE THE "IF" STATEMENT IN EXCEL

Not exactly sure what you mean by "+1.0" but this is how you write and IF
statement in excel:
=If(G136P32,"+1.0","")
If(condition,answer_if_cond_true,answer_if_cond_fa lse)

"PRECISION SAILOR" wrote:

I would like to use an IF statement to program events on an EXCEL spread sheet.
For example, "IF G136 P32 THEN +1.0". Can this be done???
THANKS! RAFAEL DE ECHEANDIA, HAMPTON, VA

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default USE THE "IF" STATEMENT IN EXCEL

Without VBA:
=IF(G36P36,1,0)
with VBA:
Sub demo()
Set p36 = Range("P36")
Set g36 = Range("G36")
If p36.Value g36.Value Then
ActiveCell.Value = 1
End If
End Sub

--
Gary''s Student - gsnu201003


"PRECISION SAILOR" wrote:

I would like to use an IF statement to program events on an EXCEL spread sheet.
For example, "IF G136 P32 THEN +1.0". Can this be done???
THANKS! RAFAEL DE ECHEANDIA, HAMPTON, VA

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 - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM
Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo QC Coug Excel Programming 1 August 26th 05 07:09 PM
vba: How do I write a "For Each Statement" nested in a "With Statement"? Mcasteel[_30_] Excel Programming 1 November 8th 04 09:47 PM
vba: How do I write a "For Each Statement" nested in a "With Statement"? Mcasteel[_29_] Excel Programming 0 November 8th 04 09:08 PM


All times are GMT +1. The time now is 07:49 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"