Notifications
Clear all

Formato coluna LISTBOX

7 Posts
2 Usuários
0 Reactions
1,367 Visualizações
(@kurkas)
Posts: 85
Estimable Member
Topic starter
 

Bom dia,
Como formato a coluna 10 do meu listbox de maneira que me retorne a data no formato normal (para mim), isto é, "dd, mm, yyyy".
É que na célula quando eu tenho 12-03-2016 aparece-me no listbox 03/12/2016.

help me!!

 
Postado : 15/01/2016 6:18 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Bom dia!!

Já consultou a nossa base?
https://cse.google.com.br/cse?cx=partne ... gsc.page=1

Att

 
Postado : 15/01/2016 8:19 am
(@kurkas)
Posts: 85
Estimable Member
Topic starter
 

Olá,
Já pesquisei e encontrei questões similares, mas não estou a conseguir adaptar ao meu cóidigo.

Private Sub PreencheLista(ByVal TextoDigitado As String)
Dim ws As Worksheet
Dim i As Integer
Dim x As Integer
Dim indiceLista As Integer
Dim coluna As Integer
Dim TextoCelula As String

Set ws = ThisWorkbook.Worksheets(NomePlanilha)
Dim Lista()

ReDim Lista(ws.UsedRange.Columns.Count, 0)

i = LinhaCabecalho + 1
indiceLista = 1
coluna = Me.ComboBoxCampos.ListIndex + 1
Call PreencheCabecalho(Lista)

With ListBoxLista

.Clear
.ColumnWidths = "60;60;100;70;160;60;40;40;60;60;60;60;60"

End With

With ws
While .Cells(i, coluna).Value <> Empty
TextoCelula = .Cells(i, coluna).Value
If UCase(Left(TextoCelula, Len(TextoDigitado))) = UCase(TextoDigitado) Then

For x = 0 To ws.UsedRange.Columns.Count - 1
ReDim Preserve Lista(ws.UsedRange.Columns.Count, indiceLista)
Lista(x, indiceLista) = .Cells(i, x + 1)
Next

indiceLista = indiceLista + 1
End If
i = i + 1
Wend
End With

 
Postado : 15/01/2016 8:59 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Boa tarde!!

Tem como ver seu arquivo modelo com o listbox e dados simulados?

Att

 
Postado : 15/01/2016 11:11 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Seria algo =/- assim:

...
For x = 0 To ws.UsedRange.Columns.Count - 1
ReDim Preserve Lista(ws.UsedRange.Columns.Count, indiceLista)
if x=10 then
Lista(x, indiceLista) = format(.Cells(i, x + 1),"dd,mm,aaaa")
else
Lista(x, indiceLista) = .Cells(i, x + 1)
end if
Next
...
 
Postado : 15/01/2016 11:29 am
(@kurkas)
Posts: 85
Estimable Member
Topic starter
 

Aqui vai o anexo.

 
Postado : 16/01/2016 5:25 am
(@kurkas)
Posts: 85
Estimable Member
Topic starter
 

Bom dia,
Entretanto resolvi com a ajuda da resposta do Reinaldo.
Um grande obrigado.

 
Postado : 16/01/2016 5:30 am