Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
Por needfsw
Posts
#10391
gostaria de saber um código vba para colocar uma pasta de trabalho fique com alinha ativa em destaque.

((Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = xlColorIndexNone
ActiveCell.EntireRow.Interior.ColorIndex = 36
End Sub))

já utilizo o código acima mas em cada planilha. tem como ser em toda pasta de trabalho.

Desde já agradeço.
Avatar do usuário
Por Kledison
Avatar
#10397
Boa noite,

tente esse código, coloque em ESTA_PASTA_DE_TRABALHO:
Código: Selecionar todos
Dim Linha As Long 'Variavel global
'Função que colore a linha da celula atualmente selecionada
Private Sub Workbook_Activate()
    On Error Resume Next
    Cells.Interior.ColorIndex = xlColorIndexNone
ActiveCell.EntireRow.Interior.ColorIndex = 36
End Sub

'Chamada das respectiva função toda vez que uma nova célula é selecionada
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
   
   Call Workbook_Activate
End Sub
Att
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord