ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   simple question (https://www.excelbanter.com/excel-programming/340356-simple-question.html)

Gary Keramidas[_2_]

simple question
 
is there any shorter way than using xldown twice?

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

--


Gary




R.VENKATARAMAN

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







Norman Jones

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






Gary Keramidas[_2_]

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









Gary Keramidas[_2_]

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








Dave Peterson

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

Gary Keramidas[_2_]

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




Tom Ogilvy

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






Default User

simple question
 
thanks tom, i had spaces near both ends, in this case


Gry


"Tom Ogilvy" wrote in message
...
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







Gary Keramidas[_2_]

simple question
 
sorry, the new vista build automatically sets up this newsgroup by default
and i didn't realize it didn't have my info until i posted.


Gary


"Tom Ogilvy" wrote in message
...
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








All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com