Results 1 to 9 of 9

Max function for all columns

Threaded View

  1. #1
    Registered User
    Join Date
    10-19-2016
    Location
    New York City, New York
    MS-Off Ver
    2015
    Posts
    13

    Max function for all columns

    Hi I'm trying to find the max value for each column with this code, but it stops after a blank row. I want the code to find the max of the entire column even if there are blank rows in the data. Any idea how to fix this code? Or is there a better way to write the code? Thanks!

    'Outputting max value for each column
    Sub Max_Columns()
    
        With Range("A2").CurrentRegion
            Range("A1").Resize(, .Columns.Count).FormulaR1C1 = "=MAX(R[2]C:R[" & .Rows.Count & "]C)"
        End With
        
        'Paste values
        Rows(1).EntireRow.Copy
        Rows(1).PasteSpecial xlPasteValues
    
    End Sub
    Last edited by alansidman; 10-21-2016 at 12:51 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2013, 05:36 PM
  2. Replies: 5
    Last Post: 10-26-2012, 02:21 PM
  3. Replies: 3
    Last Post: 10-27-2010, 03:11 AM
  4. Function recognizes two columns and adds total of two other columns
    By grafx77 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-18-2007, 09:09 AM
  5. Using a function to compare three columns
    By brainfreeze in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2006, 06:38 AM
  6. Need Function to Compare two columns
    By mikess314 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2006, 06:37 PM
  7. [SOLVED] min function from different columns
    By sonofroy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-06-2005, 06:06 PM
  8. [SOLVED] 'IF' FUNCTION for 2 columns
    By Lisa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-26-2005, 01: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