Search a word in the column
Closed
Nalini
-
Sep 15, 2011 at 06:37 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 16, 2011 at 12:22 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 16, 2011 at 12:22 AM
Related:
- Search a word in the column
- How to search for a word within a website - Guide
- How to search for a word in a pdf - Guide
- How to delete a column in word - Guide
- Ms word mod apk for pc - Download - Word processors
- Ms word pdf extension - Download - Other
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Sep 16, 2011 at 12:22 AM
Sep 16, 2011 at 12:22 AM
try this macro
there are two input boxes one for the word and one for t he relevant column number
there are two input boxes one for the word and one for t he relevant column number
Sub test()
Dim j As Long, x As String, cfind As Range, add As String
x = InputBox("type the word you want to find")
j = InputBox("the column no. where the word appearss")
With Columns(j)
Set cfind = .Cells.Find(what:=x, lookat:=xlWhole)
If Not cfind Is Nothing Then
add = cfind.Address
cfind.Offset(0, 1) = "exempt"
End If
Do
Set cfind = .Cells.FindNext(cfind)
If cfind Is Nothing Then Exit Do
If cfind.Address = add Then Exit Do
cfind.Offset(0, 1) = "exempt"
Loop
End With
End Sub