+ Reply to Thread
Results 1 to 4 of 4

Finding Maximum from Cell to Last Entry in each column : Using For..Next

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Finding Maximum from Cell to Last Entry in each column : Using For..Next

    Hello all ,

    What I like help with :
    • I am trying to find maximum from a 44 values in 3 different columns. These three columns are 4 columns apart from each other . Example : values are in Range M9 thru M53 and Range P9 thru P53 and so on


    I tried the following code

    Sub Max_BM()
    Dim col1
    For col1 = 12 To 17 Step 3
    If Cells(2, col1) > 0 Then   'predefined value in all these cell ranges
     a = WorksheetFunction.Max(Cells(2, col1).Offset(7, 1), Cells(2, col1).Offset(7, 1).End(xlDown))
    End If
    Next
    End Sub
    What it gives ?
    • It gives the value of Cells(2, col1) .Offset(7, 1)
    • It doesn't look until Cells(2, col1).Offset(7, 1).End(xlDown)

    Any help is much appreciated.

    Thank you
    Last edited by subbby; 11-16-2018 at 12:06 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,135

    Re: Finding Maximum from Cell to Last Entry in each column : Using For..Next

    Try
    a = WorksheetFunction.Max(Range(Cells(2, col1).Offset(7, 1), Cells(2, col1).Offset(7, 1).End(xlDown)))

  3. #3
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Finding Maximum from Cell to Last Entry in each column : Using For..Next

    Quote Originally Posted by Fluff13 View Post
    Try
    a = WorksheetFunction.Max(Range(Cells(2, col1).Offset(7, 1), Cells(2, col1).Offset(7, 1).End(xlDown)))
    Thank you very much. Thanks for your time. Appreciate it

    It worked like a charm

    Thanks

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,135

    Re: Finding Maximum from Cell to Last Entry in each column : Using For..Next

    Glad to help & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] finding a maximum value from column which has grouped data
    By learnings in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2017, 03:26 AM
  2. Finding an adjacent value after finding a maximum value on another column
    By VanCricken in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-10-2016, 11:58 AM
  3. Replies: 7
    Last Post: 10-07-2015, 03:01 PM
  4. finding the minimum value in a column that comes after the maximum value
    By rantarctica in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-11-2008, 04:42 PM
  5. Finding the cell address of maximum value
    By Siddhartha in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-14-2007, 04:07 AM
  6. Replies: 1
    Last Post: 07-26-2005, 12:05 PM
  7. Finding last entry in column
    By Phil in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2005, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1