Highlight entire row based on text in specific cell

sameeruddin1001

New Member
Joined
Mar 2, 2021
Messages
4
Office Version
  1. 2007
Platform
  1. Windows
I have my data in excel from A11 : R1021 of sheet1, if I give a six or seven digit number (EX: 123456) in cell B1 and press ENTER KEY the Excel should automatically find that number from the data range mentioned above (i.e. A11 : R1021) and highlight the entire row (for ex: if the number is located in cell D99, then excel should automatically highlight the entire row from A99 : R99)

Please help me with a VB macro for this.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Perhaps, another way by formula (Conditional Formatting in range $A$12:$R$16)
Code:
=SEARCH(TEXT($B$1,0),$D12)
or
=SEARCH(TEXT($B$1,0),$A12&"-"&$B12&"-"&$C12&"-"&$D12&"-"&$E12&"-"&$F12&"-"&$G12&"-"&$H12&"-"&$I12&"-"&$J12&"-"&K12&"-"&L12&"-"&$M12&"-"&$N12&"-"&$O12&"-"&$P12&"-"&$Q12&"-"&$R12&"-")
 

Attachments

  • sameeruddin1001.png
    sameeruddin1001.png
    13.5 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,755
Members
449,049
Latest member
excelknuckles

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