Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Stupid End(xlup) problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Stupid End(xlup) problem

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Stupid End(xlup) problem

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!






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Stupid End(xlup) problem

I am glad to help and glad to agree with Chip.

--
Don Guillett
SalesAid Software

"Steph" wrote in message
...
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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding .End(xlUp) (1,1) Dennis Excel Discussion (Misc queries) 4 April 4th 23 02:13 PM
End(xlUp) question CoolBusiness Excel Discussion (Misc queries) 4 March 26th 09 07:07 PM
Pivot tables, stupid problem evaluaciondeproyectos08 Excel Discussion (Misc queries) 3 February 8th 07 03:35 PM
problem with .end(xlUp).row [email protected] Excel Discussion (Misc queries) 4 December 29th 06 01:24 PM
XLUP FInd Error Todd Huttenstine Excel Programming 3 August 12th 04 07:52 AM


All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"