Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, Folks
I'm fairly adept at developing answers to my problems using worksheet functions as long as they're entered into cells. Getting the same functionality while using VB is a whole new ball of wax for me. Is there an on-line reference you can recommend for this? My reference books simply do not address my needs. Ex: How do I write VB script to nest the AND and IF worksheet functions? Thank you, Randy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.Formula = "=If(AND(A1=""Snore"",B1=5),""House"",""Dog"") "
other than that, you wouldn't be nesting worksheet functions in VB. Perhaps you can clarify your question if that isn't what you were looking for. -- Regards, Tom Ogilvy "RAP" wrote in message ... Hello, Folks I'm fairly adept at developing answers to my problems using worksheet functions as long as they're entered into cells. Getting the same functionality while using VB is a whole new ball of wax for me. Is there an on-line reference you can recommend for this? My reference books simply do not address my needs. Ex: How do I write VB script to nest the AND and IF worksheet functions? Thank you, Randy |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Thanks for the reply. I'm just having a difficult time with VB Syntax because my references aren't for 2003. I guess it changes from version to version. And, being fairly new to VB doesn't help either. I'm sure what you sent will be a big help. I'm compiling lots of things that interest me from this newsgroup. I'd be a dead duck if it weren't for you guys and this newsgroup. Maybe one day I can actually help someone out by answering a question, instead of being a "taker" all the time. Thanks again. - Randy "Tom Ogilvy" wrote: ActiveCell.Formula = "=If(AND(A1=""Snore"",B1=5),""House"",""Dog"") " other than that, you wouldn't be nesting worksheet functions in VB. Perhaps you can clarify your question if that isn't what you were looking for. -- Regards, Tom Ogilvy "RAP" wrote in message ... Hello, Folks I'm fairly adept at developing answers to my problems using worksheet functions as long as they're entered into cells. Getting the same functionality while using VB is a whole new ball of wax for me. Is there an on-line reference you can recommend for this? My reference books simply do not address my needs. Ex: How do I write VB script to nest the AND and IF worksheet functions? Thank you, Randy |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VB(A) doesn't really change from version to version. There may be some
additions, rarely any deletions, but things written in earlier versions generally run in later versions. -- Regards, Tom Ogilvy "RAP" wrote in message ... Tom, Thanks for the reply. I'm just having a difficult time with VB Syntax because my references aren't for 2003. I guess it changes from version to version. And, being fairly new to VB doesn't help either. I'm sure what you sent will be a big help. I'm compiling lots of things that interest me from this newsgroup. I'd be a dead duck if it weren't for you guys and this newsgroup. Maybe one day I can actually help someone out by answering a question, instead of being a "taker" all the time. Thanks again. - Randy "Tom Ogilvy" wrote: ActiveCell.Formula = "=If(AND(A1=""Snore"",B1=5),""House"",""Dog"") " other than that, you wouldn't be nesting worksheet functions in VB. Perhaps you can clarify your question if that isn't what you were looking for. -- Regards, Tom Ogilvy "RAP" wrote in message ... Hello, Folks I'm fairly adept at developing answers to my problems using worksheet functions as long as they're entered into cells. Getting the same functionality while using VB is a whole new ball of wax for me. Is there an on-line reference you can recommend for this? My reference books simply do not address my needs. Ex: How do I write VB script to nest the AND and IF worksheet functions? Thank you, Randy |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to think of VB as instructions rather than a function that gives a
result (of course you can build a function out of VB instructions). In VB code you make a basic IF statement: IF Condition THEN... Now you can think of Condition as one condition or as a combination of several (that in the end give either a true/false result). If several you would write IF condition1 AND/OR condition2 AND/OR condition3 AND/OR condition 4 ... The order of the conditions is important since you can come to different results depending on how it is interpreted; for example True OR False AND False could be interpreted as either (True AND False) OR False, which would be False, or as True OR (False AND False), which is True. VB will evaluate left to right unless directed otherwise by brackets (it will do whatever is inside the innermost brackets first). Whenever there is potential for confusion - even my own confusion, not VB's! - I use brackets to make my intentions clear. So, in the end, I might write: IF ((Range("A1").Value = 100) AND ((Range("B1").Value<=Date) OR (Range("C1").Value=True)) Then... My response should show that VB is conceptually very different from worksheet functions; VB works in discrete and very detailed steps where you need to assemble the pieces, whereas worksheet functions do most of the work for you if you only know how to supply the parameters. For that reason I am doubtful any reference exists that tries to go from one to the other; I think you would do better learning VB from scratch (there are many references available), without thinking about worksheet functions yet. In the end it all comes together. -- - K Dales "RAP" wrote: Hello, Folks I'm fairly adept at developing answers to my problems using worksheet functions as long as they're entered into cells. Getting the same functionality while using VB is a whole new ball of wax for me. Is there an on-line reference you can recommend for this? My reference books simply do not address my needs. Ex: How do I write VB script to nest the AND and IF worksheet functions? Thank you, Randy |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
K Dale,
Thanks for the input. I'm definitely quite a ways from "in the end it'll all come together." ha! Thanks for the info and the encouragement. Randy "K Dales" wrote: You need to think of VB as instructions rather than a function that gives a result (of course you can build a function out of VB instructions). In VB code you make a basic IF statement: IF Condition THEN... Now you can think of Condition as one condition or as a combination of several (that in the end give either a true/false result). If several you would write IF condition1 AND/OR condition2 AND/OR condition3 AND/OR condition 4 ... The order of the conditions is important since you can come to different results depending on how it is interpreted; for example True OR False AND False could be interpreted as either (True AND False) OR False, which would be False, or as True OR (False AND False), which is True. VB will evaluate left to right unless directed otherwise by brackets (it will do whatever is inside the innermost brackets first). Whenever there is potential for confusion - even my own confusion, not VB's! - I use brackets to make my intentions clear. So, in the end, I might write: IF ((Range("A1").Value = 100) AND ((Range("B1").Value<=Date) OR (Range("C1").Value=True)) Then... My response should show that VB is conceptually very different from worksheet functions; VB works in discrete and very detailed steps where you need to assemble the pieces, whereas worksheet functions do most of the work for you if you only know how to supply the parameters. For that reason I am doubtful any reference exists that tries to go from one to the other; I think you would do better learning VB from scratch (there are many references available), without thinking about worksheet functions yet. In the end it all comes together. -- - K Dales "RAP" wrote: Hello, Folks I'm fairly adept at developing answers to my problems using worksheet functions as long as they're entered into cells. Getting the same functionality while using VB is a whole new ball of wax for me. Is there an on-line reference you can recommend for this? My reference books simply do not address my needs. Ex: How do I write VB script to nest the AND and IF worksheet functions? Thank you, Randy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need reference for max and [#this row] functions | Excel Worksheet Functions | |||
Online help for Excel VB Reference | Setting up and Configuration of Excel | |||
GET PAID $2000 PER WEEK FROM ONLINE MONEY MAKING PROGRAMME.THEREALPROGRAMME IN ONLINE | Excel Worksheet Functions | |||
Excel 2007 : Online Resource Materials on Functions and Formulas | Excel Discussion (Misc queries) | |||
Can't open online Help - get "Register for My Office Online" | Excel Discussion (Misc queries) |