Related:
- Change a cell by clicking on it using VB
- Mouse not clicking where pointer is - Guide
- Why is my mouse clicking on its own - Guide
- Change computer name cmd - Guide
- Change lg tv name - Guide
- How to change number of best friends on snapchat - Guide
1 response
suppose the data are in column A
try this macro
try this macro
Sub test() Dim j As Range, k As Integer, m As Integer Dim x, cfind As Range, add As String On Error Resume Next Columns("A:A").Interior.ColorIndex = xlNone x = InputBox("type the number you want e.g 4") Range("a1").Select Set j = Columns("a:a").Cells.Find(what:=x, lookat:=xlWhole) If j Is Nothing Then MsgBox "the value " & x & " not available " GoTo line1 End If add = j.Address j.Interior.ColorIndex = 3 Do Set j = Cells.FindNext(j) If j Is Nothing Then GoTo line1 If j.Address = add Then GoTo line1 j.Interior.ColorIndex = 3 Loop line1: End Sub