Forum

How I find specific...
 
Notifications
Clear all

How I find specific word in selected column using VBA code

2 Posts
2 Users
0 Reactions
234 Views
(@rutujayadav70gmail-com)
Posts: 1
New Member
Topic starter
 

I want to search "Total" which is in 1st column so I used code to select column A

Range("A:A").EntireColumn.select Which select row A successfully.so how I further search "Total" into that row?

 
Posted : 25/10/2021 8:44 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Rutuja,

You haven't supplied a workbook with sample data so I'm guessing at what you are working with.

You could try this

Sub FindWord()

If Not Range("A:A").Find("Total", Lookat:=xlWhole) Is Nothing Then

Range("A:A").Find("Total", Lookat:=xlWhole).Select

End If

End Sub

But it's better not to select entire columns.  Try creating a table or named range, or just working with the range containing data if you know it e.g. A1:A10.

Regards

Phil

 
Posted : 27/10/2021 7:05 pm
Share: