Notifications
Clear all

Acrescentar valor anterior + 1 enquanto tiver informação

1 Posts
1 Usuários
0 Reactions
566 Visualizações
(@cmbruno)
Posts: 0
New Member
Topic starter
 

Bom dia a todos,

Estou precisando de uma ajuda de vocês.

Tenho a macro abaixo onde o primeiro bloco dela esta funcionando certinho, porém para que o restante rode é necessário que o campo " SelectedNode = " 1" no segundo bloco altere seu valor sempre em valor anterior + 1  iniciando por 1 enquanto estiver linha com informações preenchidas que é o que a variavel ulinha esta fazendo no bloco 1.

ulinha = Cells(Cells.Rows.Count, "M").End(xlUp).Row
For i = 3 To ulinha

session.findById("wnd[0]/usr/subCA_SEL_SCREEN1:YEXGL_CONTRACT_APPROP:1101/txtS_TICKET-LOW").Text = Cells(i, "M")
session.findById("wnd[0]/usr/subCA_SEL_SCREEN3:YEXGL_CONTRACT_APPROP:1103/ctxtS_CTRTM-LOW").Text = ""
session.findById("wnd[0]/usr/subCA_SEL_SCREEN1:YEXGL_CONTRACT_APPROP:1101/txtS_TICKET-LOW").SetFocus
session.findById("wnd[0]/usr/subCA_SEL_SCREEN1:YEXGL_CONTRACT_APPROP:1101/txtS_TICKET-LOW").caretPosition = 7
session.findById("wnd[0]/tbar[1]/btn[8]").press

session.findById("wnd[0]/usr/cntlCA_OVERVIEW_TREE/shellcont/shell/shellcont[1]/shell[1]").selectedNode = " 1"
session.findById("wnd[0]/usr/cntlCA_OVERVIEW_TREE/shellcont/shell/shellcont[1]/shell[0]").pressContextButton "PRINT"
session.findById("wnd[0]/usr/cntlCA_OVERVIEW_TREE/shellcont/shell/shellcont[1]/shell[0]").selectMenuItem "PRINT_VOUCHER_COMM"
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/chkSSFPP-TDIMMED").Selected = True
session.findById("wnd[1]/usr/ctxtSSFPP-TDDEST").Text = "locn"
session.findById("wnd[1]/usr/chkSSFPP-TDIMMED").SetFocus
session.findById("wnd[1]/tbar[0]/btn[86]").press

Next i

 
Postado : 11/08/2023 9:31 am