Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default early beginner, simple question about End(xlUp)

Hi,

Does the following tells Excel or Vba to assign the lastest bottom
cell in the range A:A to BottomCell. In other words, is it a single
cell being taken in consideration or is it a range? Because for me,
from A65526 to xlUp, wherever is xlup it is a range.

Still about that entrie below, could this object be a mulitple column
range? Or the fact that "A" is mentionned in A65536 tells Vba to look
in A column only?

Set BottomCel = Range("A65536").End(xlUp)

What about this way to do it?

iEndRow = Sheets(4).Range("B2").End(xlDown).Row
Sheets(4).Range("D4:D" & iEndRow)

===========end of simple question===========

============thanks for your help============

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default early beginner, simple question about End(xlUp)

Still about that entrie below, could this object be a mulitple column
range? Or the fact that "A" is mentionned in A65536 tells Vba to look
in A column only?

Set BottomCel = Range("A65536").End(xlUp)


It looks in Col-A only. It's the same as manually - select A65536, press
End, up-arrow.

What about this way to do it?

iEndRow = Sheets(4).Range("B2").End(xlDown).Row


Again, same as manually - select B2, press End, down-arrow.
With your '.Row' the code returns the row number of the range returned by
'.End(xlDown)'

Sheets(4).Range("D4:D" & iEndRow)


Apart from (presumably) needing to assign the returned range to a range
variable, you might want to cater for the the possibility that iEndRow = 3
(if B3 is not empty and B3 is empty) or iEndRow = 65536 if there is no data
below B2.

===========end of simple answer ===========

Regards,
Peter T

"wbrowse" wrote in message
ups.com...
Hi,

Does the following tells Excel or Vba to assign the lastest bottom
cell in the range A:A to BottomCell. In other words, is it a single
cell being taken in consideration or is it a range? Because for me,
from A65526 to xlUp, wherever is xlup it is a range.

Still about that entrie below, could this object be a mulitple column
range? Or the fact that "A" is mentionned in A65536 tells Vba to look
in A column only?

Set BottomCel = Range("A65536").End(xlUp)

What about this way to do it?

iEndRow = Sheets(4).Range("B2").End(xlDown).Row
Sheets(4).Range("D4:D" & iEndRow)

===========end of simple question===========

============thanks for your help============



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default early beginner, simple question about End(xlUp)

Okay, i think it helps. Thanks

Just I forgot to change B2 to D4 to make iEndRow work within the same
column as the one assigned the line above.

Things should take shape if I keep writting (copying) lines of code
from different sources and make comparaisons...as a way to learn

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default early beginner, simple question about End(xlUp)

Set BottomCel = Range("A65536").End(xlUp)

This goes to the bottom of column A and finds the first filled cell.
BottomCel is set to that cell

iEndRow = Sheets(4).Range("B2").End(xlDown).Row


Works on the 4th worksheet in the workbook. If you have something in
B2:B15, nothing in B16 or B17 and then something in B18, iEndRow will return
15.

HTH,
Barb Reinhardt



"wbrowse" wrote:

Hi,

Does the following tells Excel or Vba to assign the lastest bottom
cell in the range A:A to BottomCell. In other words, is it a single
cell being taken in consideration or is it a range? Because for me,
from A65526 to xlUp, wherever is xlup it is a range.

Still about that entrie below, could this object be a mulitple column
range? Or the fact that "A" is mentionned in A65536 tells Vba to look
in A column only?

Set BottomCel = Range("A65536").End(xlUp)

What about this way to do it?

iEndRow = Sheets(4).Range("B2").End(xlDown).Row
Sheets(4).Range("D4:D" & iEndRow)

===========end of simple question===========

============thanks for your help============


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
early beginner not satisfied with simple macro wbrowse Excel Programming 2 June 15th 07 06:06 PM
Simple problem, must be too early... AD108[_2_] Excel Programming 3 March 8th 07 03:27 PM
Simple beginner question Jeff Roper[_3_] Excel Programming 0 November 11th 04 10:37 AM
Simple beginner question Jeff Roper[_2_] Excel Programming 2 November 11th 04 06:51 AM
Simple beginner question Jeff Roper Excel Programming 3 November 10th 04 01:20 PM


All times are GMT +1. The time now is 04:10 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"