ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tom Olgilvy Question (https://www.excelbanter.com/excel-programming/286810-tom-olgilvy-question.html)

Ray Batig

Tom Olgilvy Question
 
Tom,
You recently suggested how to find the next blank cell in a row in the
following note:

if you have columns A5:C5 with values, Cells D5 blank, Cells E5:H5 with
values
then D5 would be an embedded blank cell and doing
Cells(5,1).end(xltoright)(1,2) would find D5.

Cells(5,256).End(xltoLeft)(1,2) would find I5.

--
Regards,
Tom Ogilvy

I have the following code to resize a range after I added some data to it.
It works fine, except that some of my new data was blanks. Consequently my
range was too short. I would lke to implement the technique you suggested,
however, I can't seem to get it to work. Would you fix it for me?

With Range("MyRange").Resize(1,1)
.Parent.Range(.Item(1), .End(xlToRight)).Name = "MyRange"
End With

Thanks in advance for your help!

Ray



Tom Ogilvy

Tom Olgilvy Question
 
With Range("MyRange").Resize(1,1)
.Parent.Range(.Item(1), _
.parent.Cells(.Row,256).End(xlToLeft)).Name = "MyRange"
End With

--
Regards,
Tom Ogilvy


Ray Batig wrote in message
hlink.net...
Tom,
You recently suggested how to find the next blank cell in a row in the
following note:

if you have columns A5:C5 with values, Cells D5 blank, Cells E5:H5 with
values
then D5 would be an embedded blank cell and doing
Cells(5,1).end(xltoright)(1,2) would find D5.

Cells(5,256).End(xltoLeft)(1,2) would find I5.

--
Regards,
Tom Ogilvy

I have the following code to resize a range after I added some data to it.
It works fine, except that some of my new data was blanks. Consequently my
range was too short. I would lke to implement the technique you

suggested,
however, I can't seem to get it to work. Would you fix it for me?

With Range("MyRange").Resize(1,1)
.Parent.Range(.Item(1), .End(xlToRight)).Name = "MyRange"
End With

Thanks in advance for your help!

Ray





Ray Batig

Tom Olgilvy Question
 
Tom,

Thank you very much. It makes sense now.

Regards,
Ray

Tom Ogilvy wrote in message
...
With Range("MyRange").Resize(1,1)
.Parent.Range(.Item(1), _
.parent.Cells(.Row,256).End(xlToLeft)).Name = "MyRange"
End With

--
Regards,
Tom Ogilvy


Ray Batig wrote in message
hlink.net...
Tom,
You recently suggested how to find the next blank cell in a row in the
following note:

if you have columns A5:C5 with values, Cells D5 blank, Cells E5:H5

with
values
then D5 would be an embedded blank cell and doing
Cells(5,1).end(xltoright)(1,2) would find D5.

Cells(5,256).End(xltoLeft)(1,2) would find I5.

--
Regards,
Tom Ogilvy

I have the following code to resize a range after I added some data to

it.
It works fine, except that some of my new data was blanks. Consequently

my
range was too short. I would lke to implement the technique you

suggested,
however, I can't seem to get it to work. Would you fix it for me?

With Range("MyRange").Resize(1,1)
.Parent.Range(.Item(1), .End(xlToRight)).Name = "MyRange"
End With

Thanks in advance for your help!

Ray








All times are GMT +1. The time now is 07:29 AM.

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