ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help deleting rows with vba (https://www.excelbanter.com/excel-programming/315736-help-deleting-rows-vba.html)

twist

Help deleting rows with vba
 

I'm looking for a way to complete this task:


If A1 equals C1 then delete A1 through F1, repeat on to the next ro
until row is empty.


If you can leave feedback, thankyou

--
twis
-----------------------------------------------------------------------
twist's Profile: http://www.excelforum.com/member.php...fo&userid=1605
View this thread: http://www.excelforum.com/showthread.php?threadid=27515


Bob Phillips[_6_]

Help deleting rows with vba
 
cRows = Cells(Rows.Count,"A").End(xlUp).Row
For i = cRows To 1 Step -1
If Cells(i,"A").Value = Cells(i,"C").Value Then
Range("A" & i & ":F" & i).ClearContents
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"twist" wrote in message
...

I'm looking for a way to complete this task:


If A1 equals C1 then delete A1 through F1, repeat on to the next row
until row is empty.


If you can leave feedback, thankyou.


--
twist
------------------------------------------------------------------------
twist's Profile:

http://www.excelforum.com/member.php...o&userid=16055
View this thread: http://www.excelforum.com/showthread...hreadid=275151




Bob Phillips[_6_]

Help deleting rows with vba
 
I did miss an End If but the xlUp is okay. Did you cut and paste or type it
in?

cRows = Cells(Rows.Count, "A").End(xlUp).Row
For i = cRows To 1 Step -1
If Cells(i, "A").Value = Cells(i, "C").Value Then
Range("A" & i & ":F" & i).ClearContents
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
cRows = Cells(Rows.Count,"A").End(xlUp).Row
For i = cRows To 1 Step -1
If Cells(i,"A").Value = Cells(i,"C").Value Then
Range("A" & i & ":F" & i).ClearContents
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"twist" wrote in message
...

I'm looking for a way to complete this task:


If A1 equals C1 then delete A1 through F1, repeat on to the next row
until row is empty.


If you can leave feedback, thankyou.


--
twist
------------------------------------------------------------------------
twist's Profile:

http://www.excelforum.com/member.php...o&userid=16055
View this thread:

http://www.excelforum.com/showthread...hreadid=275151







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

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