VBA Search box, button and highlight

jca0078

New Member
Joined
Aug 25, 2008
Messages
25
Hi,
I need your help to simplify my searches. The goal is to have a text box where I can input a word withing my sheet and when I press the Search button it highlights all the cells with the same search value in yellow. So far I have a text box (TextBox1), a Search button, and a reset button. I'm stock trying to attach the text box to the button's macro.

The macro attached to the Search button is the following:
Code:
Sub Macro1()
'
' Macro1 Macro
'
 
'
     With Application.ReplaceFormant.Interior
             .PatternColorIndex = xlAutomatic
             .Color = 65535
             .TintAndShade = 0
             .PatternTintAndShade = 0
     End With
     Cells.Replace What:="Paul", Replacement:="Paul", LookAt:=xlPart, _
              SearchOrder:=xlByRows,
              MatchCase:=False, SearchFormat:=False, _
              ReplaceFormat:=True
End Sub

Any idea in how to have this macro look up the word within my text box instead of looking up a specific value such as "Paul"?
 
So, there are limits to the mighty Mac! Well, for now your code is a mighty step up to what I was looking for. Thx a million!
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,620
Messages
6,179,928
Members
452,949
Latest member
beartooth91

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