Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If then VB statement
My attempt doesn't work:
If Columns("B:B") = "A" And Columns("N:N") = "manual Calc" Then Columns("O:O") = "0" I need it to see if column B has value "A" in it with a matching row of column N with value "manual Calc" and if true then set the same rows column O to a value of "0". Thanks in advance for your expert advice! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
If then VB statement
try this for-next loop.
Sub readcolumns() For x = 1 To 65536 If Worksheets("Sheet1").Cells(x, 2).Text = "B" And _ Worksheets("Sheet1").Cells(x, 14).Text = "manual calc" Then Worksheets("Sheet1").Cells(x, 15).Value = "o" flag = 1 End If Next End Sub Mike "bill ch" wrote: My attempt doesn't work: If Columns("B:B") = "A" And Columns("N:N") = "manual Calc" Then Columns("O:O") = "0" I need it to see if column B has value "A" in it with a matching row of column N with value "manual Calc" and if true then set the same rows column O to a value of "0". Thanks in advance for your expert advice! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If then VB statement
Works like magic! Thanks a ton for your help!
"Mike" wrote: try this for-next loop. Sub readcolumns() For x = 1 To 65536 If Worksheets("Sheet1").Cells(x, 2).Text = "B" And _ Worksheets("Sheet1").Cells(x, 14).Text = "manual calc" Then Worksheets("Sheet1").Cells(x, 15).Value = "o" flag = 1 End If Next End Sub Mike "bill ch" wrote: My attempt doesn't work: If Columns("B:B") = "A" And Columns("N:N") = "manual Calc" Then Columns("O:O") = "0" I need it to see if column B has value "A" in it with a matching row of column N with value "manual Calc" and if true then set the same rows column O to a value of "0". Thanks in advance for your expert advice! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
If then VB statement
Your welcome and thanks for the feedback.
"bill ch" wrote: Works like magic! Thanks a ton for your help! "Mike" wrote: try this for-next loop. Sub readcolumns() For x = 1 To 65536 If Worksheets("Sheet1").Cells(x, 2).Text = "B" And _ Worksheets("Sheet1").Cells(x, 14).Text = "manual calc" Then Worksheets("Sheet1").Cells(x, 15).Value = "o" flag = 1 End If Next End Sub Mike "bill ch" wrote: My attempt doesn't work: If Columns("B:B") = "A" And Columns("N:N") = "manual Calc" Then Columns("O:O") = "0" I need it to see if column B has value "A" in it with a matching row of column N with value "manual Calc" and if true then set the same rows column O to a value of "0". Thanks in advance for your expert advice! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
If then VB statement
Hi Mike
What does the flag=1 do? thanks Slo ?B?TWlrZQ==?= wrote in : Your welcome and thanks for the feedback. "bill ch" wrote: Works like magic! Thanks a ton for your help! "Mike" wrote: try this for-next loop. Sub readcolumns() For x = 1 To 65536 If Worksheets("Sheet1").Cells(x, 2).Text = "B" And _ Worksheets("Sheet1").Cells(x, 14).Text = "manual calc" Then Worksheets("Sheet1").Cells(x, 15).Value = "o" flag = 1 End If Next End Sub Mike "bill ch" wrote: My attempt doesn't work: If Columns("B:B") = "A" And Columns("N:N") = "manual Calc" Then Columns("O:O") = "0" I need it to see if column B has value "A" in it with a matching row of column N with value "manual Calc" and if true then set the same rows column O to a value of "0". Thanks in advance for your expert advice! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
Sum if statement with a left statement | Excel Discussion (Misc queries) | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions |