ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Entire Column - Dave Peterson (https://www.excelbanter.com/excel-programming/395783-entire-column-dave-peterson.html)

Zone[_3_]

Entire Column - Dave Peterson
 
There it is again! Dave, in your reply to Darin, you used

.Range(.Columns(NextCol), .Columns(.Columns.Count)).EntireColumn.Delete

I can find no difference between this and

.Range(.Columns(NextCol), .Columns(.Columns.Count)).Delete

I can see that under some coding circumstances, failing to include
EntireColumn could cause a problem. But I wonder whether you include
EntireColumn here as a fail-safe, or out of force of habit, or did I miss
something?

Thanks,
James



Dave Peterson

Entire Column - Dave Peterson
 
It's a personal choice--more than habit, less than required.

I find that reading:

..range(...).entirecolumn.something

Documents itself better for me. I don't have to look at what's inside the
..range() portion to see that I want the entirecolumn.

If I used
activesheet.columns(1).delete
I wouldn't have used .entirecolumn.



Zone wrote:

There it is again! Dave, in your reply to Darin, you used

.Range(.Columns(NextCol), .Columns(.Columns.Count)).EntireColumn.Delete

I can find no difference between this and

.Range(.Columns(NextCol), .Columns(.Columns.Count)).Delete

I can see that under some coding circumstances, failing to include
EntireColumn could cause a problem. But I wonder whether you include
EntireColumn here as a fail-safe, or out of force of habit, or did I miss
something?

Thanks,
James


--

Dave Peterson

JLGWhiz

Entire Column - Dave Peterson
 
Hi James, I am looking at the Range(.Columns(NextCol),
..Columns(.Columns.Count)) and thinking that might be either a single cell or
a horizontal range in which case if the .EntireColumn property wasn't
included, then only the portion called out by the Range reference would be
deleted. I do not see the Range reference as being equivalent to the
statement that includes .EntireColumn.

"Zone" wrote:

There it is again! Dave, in your reply to Darin, you used

.Range(.Columns(NextCol), .Columns(.Columns.Count)).EntireColumn.Delete

I can find no difference between this and

.Range(.Columns(NextCol), .Columns(.Columns.Count)).Delete

I can see that under some coding circumstances, failing to include
EntireColumn could cause a problem. But I wonder whether you include
EntireColumn here as a fail-safe, or out of force of habit, or did I miss
something?

Thanks,
James




Zone[_3_]

Entire Column - Dave Peterson
 
I see exactly what you're saying. My main concern is not to give bad advice
in here. If I'm absolutely sure I'm working with columns (or rows), I'm not
going to worry about including the Entire part. If I'm not 100% sure, I'll
include it. And, of course, always including it does no harm and covers the
odd unforeseen situation. As always, thank you for lending your expertise
to the newsgroup. James

"Dave Peterson" wrote in message
...
It's a personal choice--more than habit, less than required.

I find that reading:

.range(...).entirecolumn.something

Documents itself better for me. I don't have to look at what's inside the
.range() portion to see that I want the entirecolumn.

If I used
activesheet.columns(1).delete
I wouldn't have used .entirecolumn.



Zone wrote:

There it is again! Dave, in your reply to Darin, you used

.Range(.Columns(NextCol),
.Columns(.Columns.Count)).EntireColumn.Delete

I can find no difference between this and

.Range(.Columns(NextCol), .Columns(.Columns.Count)).Delete

I can see that under some coding circumstances, failing to include
EntireColumn could cause a problem. But I wonder whether you include
EntireColumn here as a fail-safe, or out of force of habit, or did I miss
something?

Thanks,
James


--

Dave Peterson




Zone[_3_]

Entire Column - Dave Peterson
 
Whiz,
Aha! I didn't think of that. It does get kinda squishy when considering
the ramifications of range. So, it's better to include the "Entire" part as
a matter of course. Gosh, I love this place! James

"JLGWhiz" wrote in message
...
Hi James, I am looking at the Range(.Columns(NextCol),
.Columns(.Columns.Count)) and thinking that might be either a single cell
or
a horizontal range in which case if the .EntireColumn property wasn't
included, then only the portion called out by the Range reference would be
deleted. I do not see the Range reference as being equivalent to the
statement that includes .EntireColumn.

"Zone" wrote:

There it is again! Dave, in your reply to Darin, you used

.Range(.Columns(NextCol),
.Columns(.Columns.Count)).EntireColumn.Delete

I can find no difference between this and

.Range(.Columns(NextCol), .Columns(.Columns.Count)).Delete

I can see that under some coding circumstances, failing to include
EntireColumn could cause a problem. But I wonder whether you include
EntireColumn here as a fail-safe, or out of force of habit, or did I miss
something?

Thanks,
James






Dave Peterson

Entire Column - Dave Peterson
 
Oh, I wouldn't worry too much about giving wrong advice. There'll be enough
followups to set you straight <vbg.

But if you're unsure, you can just state that in your message.

I use "This worked for me" a lot! Sometimes, I'm not sure if my code does what
the OP needed--sometimes, I'm not sure if my data was an accurate representation
of the OP's data.



Zone wrote:

I see exactly what you're saying. My main concern is not to give bad advice
in here. If I'm absolutely sure I'm working with columns (or rows), I'm not
going to worry about including the Entire part. If I'm not 100% sure, I'll
include it. And, of course, always including it does no harm and covers the
odd unforeseen situation. As always, thank you for lending your expertise
to the newsgroup. James

"Dave Peterson" wrote in message
...
It's a personal choice--more than habit, less than required.

I find that reading:

.range(...).entirecolumn.something

Documents itself better for me. I don't have to look at what's inside the
.range() portion to see that I want the entirecolumn.

If I used
activesheet.columns(1).delete
I wouldn't have used .entirecolumn.



Zone wrote:

There it is again! Dave, in your reply to Darin, you used

.Range(.Columns(NextCol),
.Columns(.Columns.Count)).EntireColumn.Delete

I can find no difference between this and

.Range(.Columns(NextCol), .Columns(.Columns.Count)).Delete

I can see that under some coding circumstances, failing to include
EntireColumn could cause a problem. But I wonder whether you include
EntireColumn here as a fail-safe, or out of force of habit, or did I miss
something?

Thanks,
James


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 07:52 PM.

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