Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. I am trying to determine the max # in a column. I have the
following code: Range("B30").Formula = Application.WorksheetFunction.Max(Range("B4:B" & Rows.Count).End(xlUp).Row) But when i debug this, it says Max(Range("B4:B" & Rows.Count).End(xlUp).Row) = 2. So it looks like it is highlighting b4:b65536, then hitting end(xlup), which brings the activecell to B2. I just want it to use B4:the last used cell. I am assuming I have a paren in the worng place or something simple. Please help? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
& cells(Rows.Count,"b")).End(xlUp).Row)
-- Don Guillett SalesAid Software "Steph" wrote in message ... Hello. I am trying to determine the max # in a column. I have the following code: Range("B30").Formula = Application.WorksheetFunction.Max(Range("B4:B" & Rows.Count).End(xlUp).Row) But when i debug this, it says Max(Range("B4:B" & Rows.Count).End(xlUp).Row) = 2. So it looks like it is highlighting b4:b65536, then hitting end(xlup), which brings the activecell to B2. I just want it to use B4:the last used cell. I am assuming I have a paren in the worng place or something simple. Please help? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steph,
Try Range("B30").Formula = _ Application.WorksheetFunction.Max(Range("B4:B" & _ Cells(Rows.Count, "B").End(xlUp).Row)) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Steph" wrote in message ... Hello. I am trying to determine the max # in a column. I have the following code: Range("B30").Formula = Application.WorksheetFunction.Max(Range("B4:B" & Rows.Count).End(xlUp).Row) But when i debug this, it says Max(Range("B4:B" & Rows.Count).End(xlUp).Row) = 2. So it looks like it is highlighting b4:b65536, then hitting end(xlup), which brings the activecell to B2. I just want it to use B4:the last used cell. I am assuming I have a paren in the worng place or something simple. Please help? Thanks! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks guys!!!
"Chip Pearson" wrote in message ... Steph, Try Range("B30").Formula = _ Application.WorksheetFunction.Max(Range("B4:B" & _ Cells(Rows.Count, "B").End(xlUp).Row)) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Steph" wrote in message ... Hello. I am trying to determine the max # in a column. I have the following code: Range("B30").Formula = Application.WorksheetFunction.Max(Range("B4:B" & Rows.Count).End(xlUp).Row) But when i debug this, it says Max(Range("B4:B" & Rows.Count).End(xlUp).Row) = 2. So it looks like it is highlighting b4:b65536, then hitting end(xlup), which brings the activecell to B2. I just want it to use B4:the last used cell. I am assuming I have a paren in the worng place or something simple. Please help? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Understanding .End(xlUp) (1,1) | Excel Discussion (Misc queries) | |||
End(xlUp) question | Excel Discussion (Misc queries) | |||
Pivot tables, stupid problem | Excel Discussion (Misc queries) | |||
problem with .end(xlUp).row | Excel Discussion (Misc queries) | |||
XLUP FInd Error | Excel Programming |