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 victor2
Posts
#26879
Mestres, tudo bom?

Eu gostaria de saber se há alguma na qual eu consiga ligar a variável FOR com a planilha Excel.
Segue o código:

Ao invés de sempre acessar o comando vba e trocar o numero manualmente, gostaria de saber se consigo muda-lo diretamente no excel.


For i = 13 To 14 'contagem de célula das reservas

session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = True 'alteração para as celulas de acordo com o loop
session.findById("wnd[0]/usr/chk[1," & i & "]").SetFocus
session.findById("wnd[0]/tbar[1]/btn[20]").press
session.findById("wnd[1]/tbar[0]/btn[6]").press
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").SetFocus
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").SetFocus
session.findById("wnd[2]/tbar[0]/btn[86]").press
session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = False

Next i

Obrigado!
#26880
Veja se ajuda
Código: Selecionar todos
Sub teste()
    Dim lngContador As Long, lngIni As Long, lngFim As Long

    lngIni = shtPlan1.Range("A1").Value 'Célula A1 contém o valor inicial do loop
    lngFim = shtPlan1.Range("A2").Value 'Célula A2 contém o valor inicial do loop


    For lngContador = lngIni To lngFim
        shtPlan1.Cells(lngContador, 2).Value = lngContador
    Next lngContador
End Sub
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