problem deleting last cell in a specific row

mehdoush

New Member
Joined
Feb 23, 2009
Messages
21
hey everyone
wink.gif


i'm using a table like this one :

A B C D E

1 Main | value | value | value
| value
2 Extra | value | value | value | value
3 Main | value | value | value | value
.
.
n Extra | value | value | value
| value

i want to delete every cell in column "E" only when cell in column "A" contains "Extra" value.

help plz
wink.gif

regards
 
thanks i think i solved the problem here's the solution:

Code:
  Dim MyColumn As String
Dim MyRange As Range, MyRange1 As Range
MyColumn = "A"
myvalue = "extra"
lastrow = Cells(Rows.Count, MyColumn).End(xlUp).Row
Set MyRange = Range(MyColumn & "1:" & MyColumn & lastrow)
 For Each c In MyRange
      If (c.Value) = myvalue Then
         c.Offset(0, 4).clear

      End If
     Next c

regards
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top