ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting "most" of row (https://www.excelbanter.com/excel-programming/369523-deleting-most-row.html)

Robbyn

Deleting "most" of row
 
Hi all,

With Worksheets("Data")
Set Rng = .Cells(.Rows.Count, "A").End(xlUp)
With Rng
.EntireRow.ClearContents

How would I change the above code so that the data in column A is not
deleted but everything else on the row is deleted?

TIA,

Robbyn

Jim Cone

Deleting "most" of row
 
With Worksheets("Data")
Set Rng = .Cells(.Rows.Count, "A").End(xlUp)
Set Rng = Rng(1, 2).Resize(1, .Columns.Count - 1)
Rng.ClearContents
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Robbyn"

wrote in message
Hi all,
With Worksheets("Data")
Set Rng = .Cells(.Rows.Count, "A").End(xlUp)
With Rng
.EntireRow.ClearContents
How would I change the above code so that the data in column A is not
deleted but everything else on the row is deleted?
TIA,
Robbyn

Don Guillett

Deleting "most" of row
 
try
With Worksheets("Data")
lr=.Cells(.Rows.Count, "A").End(xlUp)
..range(.cells(lr,2),.cells(lr,"iv")).ClearContent s
end with


--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
Hi all,

With Worksheets("Data")
Set Rng = .Cells(.Rows.Count, "A").End(xlUp)
With Rng
.EntireRow.ClearContents

How would I change the above code so that the data in column A is not
deleted but everything else on the row is deleted?

TIA,

Robbyn




Robbyn

Deleting "most" of row
 
Thank you both! I tried both examples with a little tweaking and they were
successes!

"Robbyn" wrote:

Hi all,

With Worksheets("Data")
Set Rng = .Cells(.Rows.Count, "A").End(xlUp)
With Rng
.EntireRow.ClearContents

How would I change the above code so that the data in column A is not
deleted but everything else on the row is deleted?

TIA,

Robbyn


Don Guillett

Deleting "most" of row
 
glad to help

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
try
With Worksheets("Data")
lr=.Cells(.Rows.Count, "A").End(xlUp)
.range(.cells(lr,2),.cells(lr,"iv")).ClearContents
end with


--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
Hi all,

With Worksheets("Data")
Set Rng = .Cells(.Rows.Count, "A").End(xlUp)
With Rng
.EntireRow.ClearContents

How would I change the above code so that the data in column A is not
deleted but everything else on the row is deleted?

TIA,

Robbyn







All times are GMT +1. The time now is 06:00 AM.

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