Hi!
I am using the following macro to highlight cells with matching data. User needs to input a provider name in an input box and this information is then matched to a sheet named 'Deposit Methods'
Sub Search()
ProviderAccountName = InputBox("Enter the Provider Account Name you want to search for")
Dim myrange As Range
Set myrange = ThisWorkbook.Worksheets("Deposit Methods").UsedRange
For Each cell In myrange.Cells
If cell.Value = ProviderAccountName Then
cell.Interior.Color = 255
End If
Next
End Sub
Macro works OK however I have the following issues:
- Is it possible to tweak the macro to have it also select the cell that is being highlighted on the sheet 'Deposit Methods' instead of having to scroll down (look for it) manually? On this sheet there can only be one match at a time with the Input Box
- If I press cancel on the Input Box (or X to close) the macro is highlighting the entire background on the 'Deposit Method' sheet in the same colour (255). Any way to avoid this when pressing cancel or close on the Input Box?
Much appreciated!
Thanks
Bookmarks