IF and Max Formula through VBA

kpmsivaprakasam2003

New Member
Joined
Jan 28, 2020
Messages
9
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
Hi, I am using Excel 2013

I have applied the VBA formula but not return the results

Below formula:
=IF(ISNUMBER(I6),IF(VALUE(I6)=$L$6,MAX($H$6:$H$79),NA()),NA())

VBA:
Dim MyRange As Range
Set MyRange = Range("D5").Offset(1, 1 + 3).Resize(m + 1, 1)
Range("D5").Offset(1, 1 + 6).Formula = "=IF(ISNUMBER(" & Range("D5").Offset(1, 1 + 4).Address(0, 0) & ",IF(VALUE(" & Range("D5").Offset(1, 1 + 4).Address(0, 0) & "=" & Range("D5").Offset(1, 3 + 5).Address(1, 1) & ",MAX(" & MyRange.Address & "),NA()),NA())"

Thanks for Advance
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Like this:
PHP:
Set MyRange = Range("H6").Resize(m + 1, 1)
If IsNumeric(Range("I6")) And Range("I6") = Range("L6") Then
    Range("J6").Value = WorksheetFunction.Max(MyRange)
Else
    Range("J6").Value = "NA()"
End If
 
Upvote 0
A reminder:

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places (and you have), please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,215,237
Messages
6,123,811
Members
449,127
Latest member
Cyko

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top