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

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por Crafter
#6530
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.
Por Crafter
#6586
Verifiquei nestes dias e não tem como alinhar um item do listbox a direita. Por pesquisa descobri o item Listview. Este dá para alinhar. Troquei então o objeto.
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