Notifications
Clear all

msgbox inteligente

4 Posts
3 Usuários
0 Reactions
902 Visualizações
(@jnexcel)
Posts: 0
New Member
Topic starter
 

Prezados

Por favor, como faço para criar uma mensagem que possa exibir o nome existente em uma célula?

eu tenho o código abaixo para importar um determinado arquivo txt

nesse arquivo eu ter apenas uma informação (o nome do cliente)

segue código

Sub Macro1()
    Application.ScreenUpdating = False
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;C:EXCEL TESTESCLIENTE 1.txt", Destination:=Range("$A$5"))
        .Name = "CLIENTE 1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    Application.ScreenUpdating = True
    MsgBox "Olá, seja bem vindo Sr.(aqui vai aparecer o nome constante na célula a5)", vbInformation, "Mensagem"
End Sub

muito obrigado

 
Postado : 29/05/2018 2:45 pm
(@wagner-morel-vidal-nobre)
Posts: 4063
Famed Member
 

JNEXCEL,

Boa noite!

Assim:

MsgBox "Olá, seja bem vindo Sr. “ & Range (A5).Value, vbInformation, "Mensagem"
 
Postado : 29/05/2018 3:00 pm
(@xlarruda)
Posts: 0
New Member
 
 MsgBox "Olá, seja bem vindo Sr. " & [a5].Value , vbInformation, "Mensagem"
 
Postado : 29/05/2018 3:01 pm
(@jnexcel)
Posts: 0
New Member
Topic starter
 

muito obrigado a todos pela atenção

 
Postado : 05/06/2018 12:32 pm