Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default simple question

is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default simple question

not clear wh;y you need two xldowns. are there gaps in between

presume you are interested in the last possible row in the column
suppose your column is A
in that cas use
range("A65536").end(xlup)


--
remove $$$ from email addresss to send email


"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default simple question

there's a gap

--


Gary


"R.VENKATARAMAN" wrote in message
...
not clear wh;y you need two xldowns. are there gaps in between

presume you are interested in the last possible row in the column
suppose your column is A
in that cas use
range("A65536").end(xlup)


--
remove $$$ from email addresss to send email


"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default simple question

Hi Gary,

I think that your expression is optimally concise.

The alternative:

lRow = Columns(1).SpecialCells(xlBlanks)(1)(2).Row

is no shorter and requires an error handler, in case all column A cells were
populated.


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default simple question

ok thanks. just didn't know if there was "scientific notation" like command,
something like xldown(2) to tell it to do it twice.

thanks

--


Gary


"Norman Jones" wrote in message
...
Hi Gary,

I think that your expression is optimally concise.

The alternative:

lRow = Columns(1).SpecialCells(xlBlanks)(1)(2).Row

is no shorter and requires an error handler, in case all column A cells
were populated.


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default simple question

It didn't actually do it twice.

....(xldown)(2) is equivalent to ...(xldown).offset(1,0)
(come down one more row)

Gary Keramidas wrote:

ok thanks. just didn't know if there was "scientific notation" like command,
something like xldown(2) to tell it to do it twice.

thanks

--

Gary

"Norman Jones" wrote in message
...
Hi Gary,

I think that your expression is optimally concise.

The alternative:

lRow = Columns(1).SpecialCells(xlBlanks)(1)(2).Row

is no shorter and requires an error handler, in case all column A cells
were populated.


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary






--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default simple question

i realize that, i was just wondering if there was a shorter way other than
repeating the command twice

thanks

--


Gary


"Dave Peterson" wrote in message
...
It didn't actually do it twice.

...(xldown)(2) is equivalent to ...(xldown).offset(1,0)
(come down one more row)

Gary Keramidas wrote:

ok thanks. just didn't know if there was "scientific notation" like
command,
something like xldown(2) to tell it to do it twice.

thanks

--

Gary

"Norman Jones" wrote in message
...
Hi Gary,

I think that your expression is optimally concise.

The alternative:

lRow = Columns(1).SpecialCells(xlBlanks)(1)(2).Row

is no shorter and requires an error handler, in case all column A cells
were populated.


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary






--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default simple question

A lot depends on how the data is laid out and where the blank area is.

if the data is like

A1: data
A2: data
A3: space
A4: data
blank to the bottom

then you could do

cells(rows.count,1).End(xlup)

or if it is

A1: data
A2: space
A3: data
A4: data

you could use the Cells(rows.count,1).End(xlup)
--
Regards,
Tom Ogivly

"Gary Keramidas" wrote in message
...
i realize that, i was just wondering if there was a shorter way other than
repeating the command twice

thanks

--


Gary


"Dave Peterson" wrote in message
...
It didn't actually do it twice.

...(xldown)(2) is equivalent to ...(xldown).offset(1,0)
(come down one more row)

Gary Keramidas wrote:

ok thanks. just didn't know if there was "scientific notation" like
command,
something like xldown(2) to tell it to do it twice.

thanks

--

Gary

"Norman Jones" wrote in message
...
Hi Gary,

I think that your expression is optimally concise.

The alternative:

lRow = Columns(1).SpecialCells(xlBlanks)(1)(2).Row

is no shorter and requires an error handler, in case all column A

cells
were populated.


---
Regards,
Norman



"Gary Keramidas" wrote in message
...
is there any shorter way than using xldown twice?

lRow = Range("a1").End(xlDown).End(xlDown).Row

--


Gary






--

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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Question Brian Excel Discussion (Misc queries) 3 March 10th 06 10:12 AM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM
Simple VB question HammerHead Excel Programming 3 November 12th 03 07:36 PM


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

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"