bloomingflower
New Member
- Joined
- Mar 9, 2020
- Messages
- 19
- Office Version
- 2019
- Platform
- Windows
Hi,
I have one question: I am trying to figure out how to add to the middle of my recorded macro part that will take a kid name from user and mark it green in the whole spreadsheet. I have tried the code below, but it doesn't work (error object required).
Name = InputBox("Enter Kid's Name:")
Dim myrange As Range
Set myrange = Sheet1.Cells.Select
For Each cell In myrange.Cells
If cell.Value = Name Then
cell.Interior.Color = 4
End If
Next
I have one question: I am trying to figure out how to add to the middle of my recorded macro part that will take a kid name from user and mark it green in the whole spreadsheet. I have tried the code below, but it doesn't work (error object required).
Name = InputBox("Enter Kid's Name:")
Dim myrange As Range
Set myrange = Sheet1.Cells.Select
For Each cell In myrange.Cells
If cell.Value = Name Then
cell.Interior.Color = 4
End If
Next