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

Tudo que estiver relacionado ao Excel básico, como somar, calcular média, colocar bordas, etc.
  • Avatar do usuário
  • Avatar do usuário
#17731
Boa tarde pessoal, td bom??

Seguinte,

Eu tô precisando separar todas as letras de um nome.

Como assim??

Vamo lá...

O nome será inserido num intervalo mesclado (C4:AZ4).
No intervalo logo abaixo (C6:AZ6), "não mesclado" de 50 células, eu preciso que cada letra do nome seja inserida. Ex: Intervalo C4:AZ4 (mesclado) NOME: JOAO CARLOS SANTOS CABRAL. Eu preciso que fique no intervalo C6:AZ6 (não mesclado) o NOME: J-O-A-O-C-A-R-L-O-S-S-A-N-T-O-S-C-A-B-R-A-L.
Esse nome é um exemplo, posso ter nomes maiores ou menores. Por isso vou utilizar as 50 células da linha 4 e da linha 6.
E não preciso considerar espaços vazios que haverá no intervalo C4:AZ4.


Valeu meu povo!!

Abração...
#17735
Boa tarde!!

Veja essa função UDF(Função definida pelo usuário) criada por Adam Taylor
Código: Selecionar todos
Function SplitWithValue(text_value As Range, Optional separator As String = "-") As Variant
    'Function SplitWithValue // Created by Adam Taylor
    'Will return the value supplied in text_value with each individual character
    'separated by the value in separator
    
    'Takes 2 arguments
    
    'text_value = A single cell containing a text or numerical value.
    'separator = A string that will be placed between each character in text_value

    Dim strVal              As String
    Dim str                 As String
    Dim i                   As Long
    
    If text_value.Cells.Count > 1 Then
        SplitWithValue = CVErr(xlErrRef)
        Exit Function
    End If
    
    strVal = CStr(text_value.Value)
    
    For i = 1 To Len(strVal)
        str = str & Mid(strVal, i, 1) & separator
    Next i
    
    str = Left(str, Len(str) - Len(separator))
    SplitWithValue = str

End Function
Leia:
http://pt.wikihow.com/Criar-uma-Fun%C3% ... soft-Excel
Exemplo de uso (após colar o colar o código no módulo), digite em uma célula =SplitWithValue(C4), depois arraste para o lado.

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