Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default 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
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
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Macro Function HJ Excel Worksheet Functions 1 August 14th 06 02:44 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Is this a macro or a function? aapp81[_4_] Excel Programming 8 November 20th 03 10:07 PM
Is this a macro or a function? aapp81[_5_] Excel Programming 1 November 20th 03 05:31 PM


All times are GMT +1. The time now is 11:48 AM.

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"