Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi JJ, try the following....
Sub Tester() ' Dim rng As Range, rCell As Range Dim WB As Workbook, SH As Worksheet Dim r As Range, lastRow As Long Set r = ActiveSheet.UsedRange lastRow = r.Rows.Count Const sStr As String = "cat" '<<===== CHANGE Set WB = ActiveWorkbook '<<===== CHANGE Set SH = WB.Sheets("Sheet1") '<<===== CHANGE Set rng = SH.Range("A1:A" & lastRow) '<<===== CHANGE Column to search For Each rCell In rng.Cells With rCell If LCase(rCell.Value) Like "*cat*" Then rCell.Offset(0, 2).Value = "Cat" '<<=Change End If End With Next rCell End Sub Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding digits in a column based on data in a separate column | Excel Discussion (Misc queries) | |||
Search for a column based on the column header and then past data from it to another column in another workbook | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
how to move the cursor to column A after entering data column F | New Users to Excel |