![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
I have two lists that are auto-generated on a page in Column A and Column B.
e.g. Column A Pens 23 31 44 55 67 Column B Pencils 5 4 6 7 2 I want to be able to add at the end of the lists (after 67 for Pens and 2 for Pencils) , the Max value for each list using a macro. The thing of it is, this list always changes in length so how do I get a marco to automatically choose the range that it needs to sum and add the sum to the end of the lists? How about adding the Sum or Average instead? Lastly, I want to add a Conditional Format to the lists, I need the Max Value in the list to be bolded and changed the font color to red. Can this be done? Please keep in mind that this list changes every time it generated, so I need to reset the ranges for the Max/Sum/Average and the Conditional Formatting each time. Thanks! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Do the ranges always start in the same cell?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
Yes, The ranges alway start on the same cell.
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Have you tried with MAX(A:A) ?
|
|
|
|
|
|
#5 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Cosmos
Try Sub AddMyMax() Range("A65336").End(xlUp).Offset(1, 0).Formula = _ "=Max($A$1:" & Range("A65336").End(xlUp).Address & ")" End Sub This will add a MAX function to the end of any list in Column "A" |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|