ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   go to end of ROW (https://www.excelbanter.com/excel-programming/373993-go-end-row.html)

Geebee

go to end of ROW
 
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it goes
to the very next cell to the right, instead of the true last cell to the last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee


PCLIVE

go to end of ROW
 
Try this:

Range("IV6").End(xlToLeft).Select

HTH,
Paul




"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee




Don Guillett

go to end of ROW
 
try
range("g6").select ' You DONT need to do this. Just use

cells(6,columns.count).end(xltoleft).select

however, it is almost never necessary or desirable to SELECT.

--
Don Guillett
SalesAid Software

"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee




NickHK[_3_]

go to end of ROW
 
There's probably a better way, but what about thinking the otherway ; start
over to the right and come left.

Worksheets(1).Range("A4").Offset(0, 255).End(xlToLeft).Offset(0, 1).Select

NickHK

"geebee" ...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee




Gary Keramidas

go to end of ROW
 
maybe this

Sub test()
Dim lastcol As Long
lastcol = Cells(6, Columns.Count).End(xlToLeft).Column
Range(Cells(6, "g"), Cells(6, lastcol)).Select ' or use .copy iinstead of select

End Sub

--


Gary


"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it goes
to the very next cell to the right, instead of the true last cell to the last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee




Geebee

go to end of ROW
 
Neither of these solutions will work for me. After the cell G6, there is
data entered for about 5 columns... Then there is a break ...and data starts
again in like 5 columns later. So I want to ignore the column happening 5
columns later and just go to the end of the row before the break.

HOW?

Thanks in advance,
geebee


"PCLIVE" wrote:

Try this:

Range("IV6").End(xlToLeft).Select

HTH,
Paul




"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee





PCLIVE

go to end of ROW
 
So you don't actually want to go to the end of the row. You want to go to
the next break?
Possibly something like this:

If Range("G6").Value = "" _
Then
Range("H6")..end(xlToRight).Select
Else:
Range("G6").end(xlToRight).Select
End If


Or if G6 is always blank, why not just use H6.

Range("H6").end(xlToRight).Select


Regards,
Paul

"geebee" wrote in message
...
Neither of these solutions will work for me. After the cell G6, there is
data entered for about 5 columns... Then there is a break ...and data
starts
again in like 5 columns later. So I want to ignore the column happening 5
columns later and just go to the end of the row before the break.

HOW?

Thanks in advance,
geebee


"PCLIVE" wrote:

Try this:

Range("IV6").End(xlToLeft).Select

HTH,
Paul




"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to
the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has
been
entered?

Thanks in advance,
geebee







Geebee

go to end of ROW
 
Neither of these solutions will work for me. After the cell G6, there is
data entered for about 5 columns... Then there is a break ...and data starts
again in like 5 columns later. So I want to ignore the column happening 5
columns later and just go to the end of the row before the break.

HOW?

Thanks in advance,
geebee



"NickHK" wrote:

There's probably a better way, but what about thinking the otherway ; start
over to the right and come left.

Worksheets(1).Range("A4").Offset(0, 255).End(xlToLeft).Offset(0, 1).Select

NickHK

"geebee" ...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has been
entered?

Thanks in advance,
geebee





Gary Keramidas[_2_]

go to end of ROW
 
post a more detailed description of what you are trying to do. give us the
cell addresses involved, which have data, which don't and what you want to
select.

--


Gary K

"geebee" wrote in message
...
Neither of these solutions will work for me. After the cell G6, there is
data entered for about 5 columns... Then there is a break ...and data
starts
again in like 5 columns later. So I want to ignore the column happening 5
columns later and just go to the end of the row before the break.

HOW?

Thanks in advance,
geebee


"PCLIVE" wrote:

Try this:

Range("IV6").End(xlToLeft).Select

HTH,
Paul




"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to
the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has
been
entered?

Thanks in advance,
geebee






Stopher

go to end of ROW
 
Do you want a continuous string of data with no breaks, asin start at
"G6" and then go across the right of the row, and remove the blanks as
I go to create a string or array of the values?


Don Guillett

go to end of ROW
 
Sub gotoblank()
Cells(6, "g").End(xlToRight).End(xlToRight).Select
End Sub


--
Don Guillett
SalesAid Software

"geebee" wrote in message
...
Neither of these solutions will work for me. After the cell G6, there is
data entered for about 5 columns... Then there is a break ...and data
starts
again in like 5 columns later. So I want to ignore the column happening 5
columns later and just go to the end of the row before the break.

HOW?

Thanks in advance,
geebee



"NickHK" wrote:

There's probably a better way, but what about thinking the otherway ;
start
over to the right and come left.

Worksheets(1).Range("A4").Offset(0, 255).End(xlToLeft).Offset(0,
1).Select

NickHK

"geebee"
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to
the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has
been
entered?

Thanks in advance,
geebee







Don Guillett

go to end of ROW
 
Sub gotoblank()
Cells(4, 1).End(xlToRight).End(xlToRight).Select
End Sub


--
Don Guillett
SalesAid Software

"geebee" wrote in message
...
Neither of these solutions will work for me. After the cell G6, there is
data entered for about 5 columns... Then there is a break ...and data
starts
again in like 5 columns later. So I want to ignore the column happening 5
columns later and just go to the end of the row before the break.

HOW?

Thanks in advance,
geebee


"PCLIVE" wrote:

Try this:

Range("IV6").End(xlToLeft).Select

HTH,
Paul




"geebee" wrote in message
...
hi,

I have the following:

Range("G6").Select
Range(Selection, Selection.End(xlToRight)).Select

The opnly problem is that G6 is empty, so when the command executes, it
goes
to the very next cell to the right, instead of the true last cell to
the
last
where data has been entered.

How can I get it to go to the last cell to the right where data has
been
entered?

Thanks in advance,
geebee








All times are GMT +1. The time now is 01:31 PM.

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