Help with macro about deleting cells according to other cell

r_ivica

Board Regular
Joined
Jul 13, 2007
Messages
91
not sure how to do this macro, hopefully not very complicated but don't know how to do it - so i would like to have this:

- if in Q5 is word LAY to delete cell T5
- if in Q6 is word LAY to delete cell T6
- if in Q7 is word LAY to delete cell T7
- if in Q8 is word LAY to delete cell T8
- if in Q9 is word LAY to delete cell T9
- if in Q10 is word LAY to delete cell T10
- if in Q11 is word LAY to delete cell T11
- if in Q12 is word LAY to delete cell T12
- if in Q13 is word LAY to delete cell T13
- if in Q14 is word LAY to delete cell T14
- if in Q15 is word LAY to delete cell T15
- if in Q16 is word LAY to delete cell T16
- if in Q17 is word LAY to delete cell T17
- if in Q18 is word LAY to delete cell T18
- if in Q19 is word LAY to delete cell T19
- if in Q20 is word LAY to delete cell T20

tnx for helping!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
i made this with recording macro and inserting IF formulas..

but now i have only one more little different problem which i don't know to solve.

I am using conditional formatting - if cell value is more than A1 (some number) to have cell in yellow color which works fine, but a lot of time this cell have 0,00 but if there is 0,00 i would like that conditional formatting would be ignored! (not to have in this case cell yellow)

How can i achieve this?
 
Upvote 0
For your 1st part. Please try below code.
Code:
Sub DeleteCell()
Dim MyWord As String
Dim r, I As Integer

r = Range("Q65536").End(xlUp).Row

For I = 5 To r
    MyWord = Range("Q" & I).Value
    If MyWord = "Lay" Then
        Range("T" & I).ClearContents
    End If
Next I

End Sub
 
Upvote 0
I am using conditional formatting - if cell value is more than A1 (some number) to have cell in yellow color which works fine, but a lot of time this cell have 0,00 but if there is 0,00 i would like that conditional formatting would be ignored! (not to have in this case cell yellow)

So, what is the value in A1 when your cell is 0,000?
 
Upvote 0
I am using conditional formatting - if cell value is more than A1 (some number) to have cell in yellow color which works fine, but a lot of time this cell have 0,00 but if there is 0,00 i would like that conditional formatting would be ignored! (not to have in this case cell yellow)

So, what is the value in A1 when your cell is 0,000?

ok, let's say in A1 is 2,00 and if i input in B1 2,10 i want to have A1 cell yellow, so if B1 is higher than A1 want to have A1 yellow - which i have in excel worked out, but problem is when in A1 is 0,00 number and in B1 i have any number than A1 is yellow again which i don't want, i want that in this case, when there is 0,00 not to have it yellow!

This is formula which i have input in conditional formatting formula line and working, but also with zero which is not good:
=AND($B$1>=$A$1)
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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