Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an inefficient, but working, nested if-and worksheet function formula
that I need to put into a macro. I almost got "do-looped" to death today. Any help or direction would be most appreiciated. - Randy Range("H11").Select (Activecell) ActiveCell.Formula = "=IF(AND(B11=24,B18=24,B25=24,B32=24,B39=24,B46=24 ,B53=24,B60=24),TRUE,FALSE)" If ActiveCell = True Then Else: |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
RAP,
If Range("B11") = 24 And _ Range("B18") = 24 And _ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Earl,
Thank you so much for the help. I chose the Do-Loop, because I will only have to change one variable if I add another "range of 7". I'm trying to use/learn as many different techniques in this project as I can. Do-Loop won the battle this time with me, but I now have a working model to examine. Many thanks, Randy "Earl Kiosterud" wrote: RAP, If Range("B11") = 24 And _ Range("B18") = 24 And _ . . Range("B60") = 24 _ Then -------------------------------------------------- Or if the number will change: Dim CmpNum CmpNum= 24 If Range("B11") = CmpNum And _ Range("B18") = CmpNum And _ . . Range("B60") = CmpNum _ Then ----------------------------------------------------------- Or Const CmpNum = 24 If Range("B11") = CmpNumAnd _ Range("B18") = CmpNumAnd _ . . Range("B60") = CmpNum _ Then -------------------------------------------- Since they're all in column B, and are 7 cells apart, you could loop through them: Dim result As Boolean Dim i As Integer result = True For i = 11 To 60 Step 7 Cells(i, 2).Select If Cells(i, 2) < CmpNum Then result = False Exit For End If Next i If result = True Then Be aware that in any of these macro solutions, if you move the cells (including resulting from an insert or delete), these cell references will not move with them. You have to use range names in your macro for that to work. -- Earl Kiosterud www.smokeylake.com "RAP" wrote in message ... I have an inefficient, but working, nested if-and worksheet function formula that I need to put into a macro. I almost got "do-looped" to death today. Any help or direction would be most appreiciated. - Randy Range("H11").Select (Activecell) ActiveCell.Formula = "=IF(AND(B11=24,B18=24,B25=24,B32=24,B39=24,B46=24 ,B53=24,B60=24),TRUE,FALSE)" If ActiveCell = True Then Else: |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nested formula using WORKDAY function | Excel Worksheet Functions | |||
A challenge: referencing cell contents in nested function formula | Excel Worksheet Functions | |||
can you nested sum and round function within if function? | Excel Worksheet Functions | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
Nested IF Function, Date Comparing, and NetworkDays Function | Excel Worksheet Functions |