Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro For If Function
hi,
I have 6 Columns A = Number B = Number C= Number D= A x B x C E= Input Number by user F = If(D = E) = Matched/Unmatched) I want a macro the value of Column D = E then it should display Matched or Unmatched in Column F. Is it possible. Thanks in Advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro For If Function
A spreadsheet formula should work: in F1 (say) enter the formula
=If(D1=E1,"Matched","Unmatched") and copy it down for as many rows as you need. If this doesn't suffice, explain what you need in more detail. Hth -John Coleman On Feb 27, 6:53 am, "Akash" wrote: hi, I have 6 Columns A = Number B = Number C= Number D= A x B x C E= Input Number by user F = If(D = E) = Matched/Unmatched) I want a macro the value of Column D = E then it should display Matched or Unmatched in Column F. Is it possible. Thanks in Advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro For If Function
in F1
=IF(D1=E1,"Matched","Unmatched") "Akash" wrote: hi, I have 6 Columns A = Number B = Number C= Number D= A x B x C E= Input Number by user F = If(D = E) = Matched/Unmatched) I want a macro the value of Column D = E then it should display Matched or Unmatched in Column F. Is it possible. Thanks in Advance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro For If Function
On Feb 27, 5:13 pm, "John Coleman" wrote:
A spreadsheet formula should work: in F1 (say) enter the formula =If(D1=E1,"Matched","Unmatched") and copy it down for as many rows as you need. If this doesn't suffice, explain what you need in more detail. Hth -John Coleman On Feb 27, 6:53 am, "Akash" wrote: hi, I have 6 Columns A = Number B = Number C= Number D= A x B x C E= Input Number by user F = If(D = E) = Matched/Unmatched) I want a macro the value of Column D = E then it should display Matched or Unmatched in Column F. Is it possible. Thanks in Advance i require a macro for the same... is it possible... Akash |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro For If Function
Right click the sheet tab and paste this in
Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not Application.Intersect(Target, Range("E1")) Is Nothing Then If Target.Value = Cells(1, 4).Value Then Cells(1, 6).Value = "Matched" Else Cells(1, 6).Value = "Unmatched" End If End If End Sub Mike "Akash" wrote: On Feb 27, 5:13 pm, "John Coleman" wrote: A spreadsheet formula should work: in F1 (say) enter the formula =If(D1=E1,"Matched","Unmatched") and copy it down for as many rows as you need. If this doesn't suffice, explain what you need in more detail. Hth -John Coleman On Feb 27, 6:53 am, "Akash" wrote: hi, I have 6 Columns A = Number B = Number C= Number D= A x B x C E= Input Number by user F = If(D = E) = Matched/Unmatched) I want a macro the value of Column D = E then it should display Matched or Unmatched in Column F. Is it possible. Thanks in Advance i require a macro for the same... is it possible... Akash |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro For If Function
Why do you need a macro to duplicate the functionality?
Something like this could work: Sub CheckMatches() Dim R As Range Dim cl As Range Set R = Range("F1:F5") For Each cl In R.Cells If cl.Offset(0, -2).Value = cl.Offset(0, -1).Value Then cl.Value = "Matched" Else cl.Value = "Unmatched" End If Next cl End Sub adjust the range statement to get the F-range you want. You can make the sub more flexible by passing the range of rows as parameters Hth -John Coleman On Feb 27, 7:41 am, "Akash" wrote: On Feb 27, 5:13 pm, "John Coleman" wrote: A spreadsheet formula should work: in F1 (say) enter the formula =If(D1=E1,"Matched","Unmatched") and copy it down for as many rows as you need. If this doesn't suffice, explain what you need in more detail. Hth -John Coleman On Feb 27, 6:53 am, "Akash" wrote: hi, I have 6 Columns A = Number B = Number C= Number D= A x B x C E= Input Number by user F = If(D = E) = Matched/Unmatched) I want a macro the value of Column D = E then it should display Matched or Unmatched in Column F. Is it possible. Thanks in Advance i require a macro for the same... is it possible... Akash- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sub Macro vrs Function Macro Auto Start | Excel Discussion (Misc queries) | |||
Macro Function | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
Is this a macro or a function? | Excel Programming | |||
Is this a macro or a function? | Excel Programming |