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
  • Avatar do usuário
#4742
Bom dia!

Eu tenho uma lista de nomes de centros de custo na coluna B, e preciso abrir uma aba do excel para cada um deles, acho que só da pra fazer usando VBA e não sei....

Alguém pode me ajudar?

Obrigado!!!
Você não está autorizado a ver ou baixar esse anexo.
#4748
Bom dia!!

Se eu entendi, use o código abaixo!
Código: Selecionar todos
Sub AleVBA_836()
     
    Dim ws As Worksheet
    Dim Ki As Range
    Dim ListSh As Range
     
    With Worksheets("Centro de Custos")
        Set ListSh = .Range("B2:B" & .Cells(.Rows.Count, "A").End(xlUp).Row)
    End With
     
    On Error Resume Next
    For Each Ki In ListSh
        If Len(Trim(Ki.Value)) > 0 Then
            If Len(Worksheets(Ki.Value).Name) = 0 Then
                Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = Ki.Value
            End If
        End If
    Next Ki
     
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