Selecionar célula m...
 
Notifications
Clear all

Selecionar célula mesclada

2 Posts
2 Usuários
0 Likes
1,248 Visualizações
(@dunguinha)
Posts: 61
Trusted Member
Topic starter
 

Boa tarde.

Tenho uma lista de ramais com mais de 200 números.

Preciso que uma macro selecione a célula mesclada acima de onde estiver a célula ativa.

Esta explicadinho no anexo.

 
Postado : 16/05/2022 1:32 pm
EdsonBR
(@edsonbr)
Posts: 1056
Noble Member
 

Veja se é isso, colega @Dunguinha:

Sub SelMescladaAcima()
  Dim rg As Range
  If Not Intersect(ActiveCell, Columns(1)) Is Nothing Then
    If ActiveCell.MergeCells Then Exit Sub
    Application.FindFormat.MergeCells = True
     Set rg = ActiveCell.EntireColumn.Find(What:="", After:=ActiveCell, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, SearchFormat:=True)
     If Not rg Is Nothing Then rg.Activate
    Application.FindFormat.Clear
  End If
End Sub

 
Postado : 17/05/2022 4:40 pm