Hello,
I am trying to figure out why this code is not working.
I need to find merged cells in column AX. Once these merged cells arefound I need to use the following vba formula to copy the value. What am Idoing wrong?
This is the code I would get when I use the record macro function, butthe range varies and that is why I can’t use the specific text below.
Thank you
I am trying to figure out why this code is not working.
I need to find merged cells in column AX. Once these merged cells arefound I need to use the following vba formula to copy the value. What am Idoing wrong?
Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
'Select Merged cells in column AX and add header based on EntityOwnership (column BC)
If Worksheets("OTRC MORFile").Range("AX:AX").MergeCells Then
Selection.FormulaR1C1 ="=R[1]C[5]"
End If
Columns("AX:AX").Select
Application.CutCopyMode =False
Selection.Copy
Selection.PasteSpecialPaste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode =False
This is the code I would get when I use the record macro function, butthe range varies and that is why I can’t use the specific text below.
Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
Sub FindMerged()
' FindMerged Macro
Columns("AX:AX").Select
Application.FindFormat.Clear
Application.FindFormat.MergeCells = True
WithApplication.FindFormat.Font
.Subscript = False
.TintAndShade = 0
End With
WithApplication.FindFormat.Interior
.PatternColorIndex =xlAutomatic
.ColorIndex = xlAutomatic
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("AX5:BB5,AX9,AX13").Select
Selection.FormulaR1C1 ="=R[1]C[5]"
Range("AX9:BB9").Select
End Sub
Thank you