ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Column T contains then (https://www.excelbanter.com/excel-programming/437029-if-column-t-contains-then.html)

JHopper

If Column T contains then
 
Dim Defragglerow As Long
Dim RockroadRow As Long

Defragglerow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row

For RockroadRow = 1 To Defragglerow
With Cells(RockroadRow, "T")
If .Text Like "TACO*" And.Offset(, 52).Text Like "*Blank*" Then
Cells(RockroadRow, "F") = "SOFT TACO"
End If
End With
Next RockroadRow

End Sub


If any row in Column T contains TACO anywhere and that same row in Column BA
is blank I want to change the contents in Column F to €śSOFT TACO€ť. I entered
the code I have so far above. Can you help?


Don Guillett

If Column T contains then
 
try this.

If UCase(.Text) Like "TACO*" And .Offset(, 52).Text = "" Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JHopper" wrote in message
...
Dim Defragglerow As Long
Dim RockroadRow As Long

Defragglerow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row

For RockroadRow = 1 To Defragglerow
With Cells(RockroadRow, "T")
If .Text Like "TACO*" And.Offset(, 52).Text Like "*Blank*" Then
Cells(RockroadRow, "F") = "SOFT TACO"
End If
End With
Next RockroadRow

End Sub


If any row in Column T contains TACO anywhere and that same row in Column
BA
is blank I want to change the contents in Column F to €śSOFT TACO€ť. I
entered
the code I have so far above. Can you help?




All times are GMT +1. The time now is 07:09 AM.

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