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 LuisAlvarenga
#52190
Mais uma vez peço ajuda.

Estou com uma rotina While, e dentro dela quero colocar uma ou mais condições com if e desviar (loop) naquele ponto.

With Plan1
Do While .Cells(Linha, 1).Value <> ""

Data = .Cells(Linha, 1).Value
DataPag = .Cells(Linha, 6).Value

If ckPagos.Value = True And DataPag = "" Then
' minha dúvida aqui
' quero dar um loop aqui
End If
If CkPend.Value = True And DataPag <> "" Then
' minha dúvida aqui
' quero dar um loop aqui
End If

If Data >= DataIni And Data <= DataFim Then

With ListBox1
.AddItem
.List(LinhaListBox, 0) = Plan1.Cells(Linha, 1)
.List(LinhaListBox, 1) = Plan1.Cells(Linha, 2)
.List(LinhaListBox, 2) = Plan1.Cells(Linha, 3)
.List(LinhaListBox, 3) = Plan1.Cells(Linha, 4)
cValor = CStr(Format(Plan1.Cells(Linha, 5), "###,##0.00"))
.List(LinhaListBox, 4) = Space(10 - Len(cValor)) & cValor
.List(LinhaListBox, 5) = Plan1.Cells(Linha, 6)

If DataPag = "" Then
nTotPend = nTotPend + Plan1.Cells(Linha, 5)
Else
nTotPago = nTotPago + Plan1.Cells(Linha, 5)
End If


End With
LinhaListBox = LinhaListBox + 1

End If

Linha = Linha + 1

Wend

End With

Minha origem é CLIPPER e estou sofrendo com as mudanças.


Agradeço ..
Por babdallas
#52192
Tente explicar que tipo de loop você deseja fazer depois do if. Qual o comportamento que você deseja que seu código execute? Se responder a isso ficará mais fácil de ajudar.
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