Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with "Selection.End(xlUp).Row"


What could cause this code to malfunction on the
“dLastZRowPopulated = Selection.End(xlUp).Row” in:

Sub Macro1()
Dim dLastZRowPopulated As Double
Application.Goto Reference:="R10101C26" ‘Z(101:105)
Range("Z10101").Select
dLastZRowPopulated = Selection.End(xlUp).Row
End Sub

This code presented in its simplest form, and results in
dLastZRowPopulated =100, however Z(101:Z105) are populated. Any
insights as to how Z(101:Z105) are ignored?

By the way it happens on the spreadsheet as well. When in Z10101,
hitting [Ctrl] + [Up arrow] takes me to Z100 !?!?


--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=500390

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with "Selection.End(xlUp).Row"


Thanks Don

after "dLastZRowPopulated = Cells(Rows.Count, "z").End(xlUp).Row ",
dLastZRowPopulated =10101has so it went nowhere! The real sticker
is when in Z10101, on spreedsheet, hitting [Ctrl] + [Up arrow] takes me
to Z100, sounds like environment or format getting in the way?


--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=500390

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with "Selection.End(xlUp).Row"


Thanks Don

after "dLastZRowPopulated = Cells(Rows.Count, "z").End(xlUp).Row ",
dLastZRowPopulated =10101has so it went nowhere! The real sticker
is when in Z10101, on spreedsheet, hitting [Ctrl] + [Up arrow] takes me
to Z100, sounds like environment or format getting in the way?


--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=500390

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help with "Selection.End(xlUp).Row"

Any chance that Z10101 to Z101 have something in them--even formulas that
evaluate to "".

In fact, if you had formulas that evaluated to "" in those cells, then converted
them to values (edit|copy, edit|paste special|Values), then those cells aren't
empty.

Try
=counta(Z101:Z10101)

What do you get back?

Bird wrote:

What could cause this code to malfunction on the
“dLastZRowPopulated = Selection.End(xlUp).Row” in:

Sub Macro1()
Dim dLastZRowPopulated As Double
Application.Goto Reference:="R10101C26" ‘Z(101:105)
Range("Z10101").Select
dLastZRowPopulated = Selection.End(xlUp).Row
End Sub

This code presented in its simplest form, and results in
dLastZRowPopulated =100, however Z(101:Z105) are populated. Any
insights as to how Z(101:Z105) are ignored?

By the way it happens on the spreadsheet as well. When in Z10101,
hitting [Ctrl] + [Up arrow] takes me to Z100 !?!?

--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=500390


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with "Selection.End(xlUp).Row"


YES,YES,YES! Dave you hit it on the head. Formula in Z101:Z10101 is
“=IF(COUNTA(B101:G101)=0,"",COUNTA(B101:G101))”. I then copy M:M and
PasteSpecial w/ values, in M:M, to avoid hitting on the formulas. What
is the way to “Selection.End(xlUp).Row” and hitting a formula result
other than ””?


--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=500390

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help with "Selection.End(xlUp).Row"

Better to clear up that detritus.

Select all your cells (or just column Z if you want to limit it).

Edit|replace
what: (leave blank)
with: $$$$$
replace all

Followed by:
edit|Replace
what: $$$$$
with: (leave blank)
replace all

All those cells that evaluated to "" and were converted to values will be
cleaned up.

And .end(xlup) will work as it should.

Bird wrote:

YES,YES,YES! Dave you hit it on the head. Formula in Z101:Z10101 is
“=IF(COUNTA(B101:G101)=0,"",COUNTA(B101:G101))”. I then copy M:M and
PasteSpecial w/ values, in M:M, to avoid hitting on the formulas. What
is the way to “Selection.End(xlUp).Row” and hitting a formula result
other than ””?

--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=500390


--

Dave Peterson
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
Icon for "Wrap" and for "Centre Across Selection" BeSmart Excel Worksheet Functions 2 November 16th 05 06:44 PM
inalRow = Range("A65536").End(xlUp).Row ciba1234[_2_] Excel Programming 2 September 15th 05 10:28 PM
S1.Range("D65536").End(xlUp).Select Rick[_19_] Excel Programming 6 January 13th 04 01:24 AM
Question about "End(xlUp)" property Dave Peterson[_3_] Excel Programming 1 August 4th 03 04:24 AM
Question about "End(xlUp)" property Chip Pearson Excel Programming 0 August 4th 03 02:57 AM


All times are GMT +1. The time now is 06:57 PM.

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

About Us

"It's about Microsoft Excel"