Alinhar listbox a direita
Enviado: 18 Jan 2016 às 10:56
bom dia
tenho os seguintes itens em um listobox no userform1 do excel.
Private Sub ListarTodos()
Dim Lin As Integer
Dim Ultima As Long
Ultima = Sheets("PL").Range("A65000").End(xlUp).Row
ListBox1.Clear
For Lin = 2 To Ultima
UserForm1.ListBox1.AddItem Sheets("DW").Range("A" & Lin)
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 1) = Format(Sheets("PL").Range("B" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 2) = Format(Sheets("PL").Range("C" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 3) = Format(Sheets("PL").Range("D" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 4) = Format(Sheets("PL").Range("E" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 5) = Format(Sheets("PL").Range("F" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 6) = Format(Sheets("PL").Range("G" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 7) = Format(Sheets("PL").Range("H" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 8) = Format(Sheets("PL").Range("I" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 9) = Format(Sheets("PL").Range("J" & Lin), "currency")
Next
End Sub
Como todos as colunas são valores com exceção da primeira, todas alinham a esquerda. Preciso alinhar a direita os valores.
tenho os seguintes itens em um listobox no userform1 do excel.
Private Sub ListarTodos()
Dim Lin As Integer
Dim Ultima As Long
Ultima = Sheets("PL").Range("A65000").End(xlUp).Row
ListBox1.Clear
For Lin = 2 To Ultima
UserForm1.ListBox1.AddItem Sheets("DW").Range("A" & Lin)
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 1) = Format(Sheets("PL").Range("B" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 2) = Format(Sheets("PL").Range("C" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 3) = Format(Sheets("PL").Range("D" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 4) = Format(Sheets("PL").Range("E" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 5) = Format(Sheets("PL").Range("F" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 6) = Format(Sheets("PL").Range("G" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 7) = Format(Sheets("PL").Range("H" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 8) = Format(Sheets("PL").Range("I" & Lin), "currency")
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1, 9) = Format(Sheets("PL").Range("J" & Lin), "currency")
Next
End Sub
Como todos as colunas são valores com exceção da primeira, todas alinham a esquerda. Preciso alinhar a direita os valores.