Command help

  • Thread starter Thread starter Syed Haider Ali
  • Start date Start date
S

Syed Haider Ali

Dear Freinds,

can anybody explain the commands ".end(xlup), .end(xldown),
..end(xlright), .end(xlleft)". And where we use these commands.

SYED HAIDER ALI
 
assume you have data in column A. go to the end of column A (A65536) and
hit the End Key, then the Up Arrow. this is the same ans

set rng = Cells(rows.count,1).End(xlup)
rng.select

So you can use it to find the last filled cell in a column. Likewise, go to
A1 and hit the end key, then the down arrow. The focus changes to the next
cell that is filled (if there are intermediate blank cells), or the last
filled cell in a contiguous range of cells in that column.

Similar behavior to for xlright and xlLeft.

Use them when you need that information.
 
Hi Ali,

Suppose you have a xl table : Use the key c"Ctrl" + arrow key -> to get to
the last non blank cell in that row.
This way you can navigate quickly to the edges of a range by using the
keyboard (double-clicking on the cell border
will also have the same effect).
To find the last cell in a table trought vba, you can use
range("A1").end(xldown) to get to the last cell in column A.
Regards
Jean-Yves

"Syed Haider Ali"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Data Filtering 5
Hyperlink 1
Create a new Worksheet 1
Find the value 4
Two Feilds in a combo box 1
Arrange a list in ComboBox 1
Run Time Error 1004 1
Data Modification 1

Back
Top