How to concatenate or use commercial & date & text?

0

I'm using the following code to display only the day and the month.

Range("AB2").Select
ActiveCell.Value = "=Now()"
ActiveCell.NumberFormat = "yy/mm"
ultima_linha = Range("A" & Rows.Count).End(xlUp).Row
Range("AB2").AutoFill Destination:=Range("AB2:AB" & ultima_linha)

I want it to appear as follows: text / 17/31 / text. Any help on how popular the camps?

    
asked by anonymous 30.05.2017 / 18:43

2 answers

2

You can format the date in a variable and then assign the value in the cell:

Dim data As String
data = Format(Date, "dd/mm")
data = texto1 & "/" & data & "/" & texto2
ActiveCell.Value = data
    
30.05.2017 / 19:06
0

RESOLVED:

Range("AB2").Select
Dim tudo As String
data = Format(Date, "dd/mm")
tudo = "texto1/" & data & "/texto2"
ActiveCell.Value = tudo
ultima_linha = Range("A" & Rows.Count).End(xlUp).Row
Range("AB2").AutoFill Destination:=Range("AB2:AB" & ultima_linha)

Thank you in the same Ricardo Pontual!

    
30.05.2017 / 22:00