indi visual
Member
: )
...it's okay I give you permission to laugh at me for this code beneath. But it's the first code I've actually written myself without help...
..although I'm asking for help on it now because it doesn't work (lol). I hope I'm close though I really tried.
What I'm trying to do is replace the bracket content of column A with column B if they're the same. I have to use a wildcard search "{*}" because I'm not sure what will be in the brackets.
Sub Remove_Duplicate_Brace_Content
'''Macro Objective: If duplicate bracket brace content is found in adjacent column B, then delete braces and content from column A.
'Declarations
Dim SpecialCriteria As String
Dim MyRange As Long
Dim i As Long
'Declaration Definitions
SpecialCriteria = "{*}"
MyRange = Range("A2").End(xlDown).Row
For i = 1 To MyRange '''I would like this to search all the way to the last cell row of A
If Cell.Value("i").Column("A", & SpecialCriteria) = Cell.Value("i").Column("B", & SpecialCriteria) Then
'''If the the bracket content in column A matches the bracket brace content in column B then replace bracket braces and containing contents of cell in A
Column("A", i).Replace What:="{*}", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End If
Next i
End Sub
...it's okay I give you permission to laugh at me for this code beneath. But it's the first code I've actually written myself without help...
..although I'm asking for help on it now because it doesn't work (lol). I hope I'm close though I really tried.
What I'm trying to do is replace the bracket content of column A with column B if they're the same. I have to use a wildcard search "{*}" because I'm not sure what will be in the brackets.
Sub Remove_Duplicate_Brace_Content
'''Macro Objective: If duplicate bracket brace content is found in adjacent column B, then delete braces and content from column A.
'Declarations
Dim SpecialCriteria As String
Dim MyRange As Long
Dim i As Long
'Declaration Definitions
SpecialCriteria = "{*}"
MyRange = Range("A2").End(xlDown).Row
For i = 1 To MyRange '''I would like this to search all the way to the last cell row of A
If Cell.Value("i").Column("A", & SpecialCriteria) = Cell.Value("i").Column("B", & SpecialCriteria) Then
'''If the the bracket content in column A matches the bracket brace content in column B then replace bracket braces and containing contents of cell in A
Column("A", i).Replace What:="{*}", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End If
Next i
End Sub