Looking for assistance on a formula or macro. I have lots of data and I fill in a various color on certain numbers, leaving others with no color. All the non-colored cells need brackets. Best way to be able to select a full row - and execute???
Sub SquareBracketsBeforeAndAfterTexts() 'By Haytham Amairah
On Error Resume Next Application.ScreenUpdating = False Application.EnableEvents = False Application.Calculation = xlCalculationManual
Dim step1 As String Dim step2 As String Dim cell As Range
For Each cell In Selection If cell.Interior.ColorIndex = -4142 Then step1 = Application.WorksheetFunction.Replace(cell, 1, 0, "[") step2 = Application.WorksheetFunction.Replace(step1, Len(step1) + 1, 0, "]") cell.Value = step2 End If Next