Acrescentar valor anterior + 1 enquanto tiver informação

cmbruno

New Member
Joined
Aug 14, 2023
Messages
1
Office Version
  1. 365
Bom dia a todos,
Estou precisando de uma ajuda de vocês.

Tenho uma 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 ocorre que é o que a variavel ulinha esta fazendo no bloco 1.

ulinha = Cells(Cells.Rows.Count, "M").End(xlUp).Row
Para 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").Texto = ""
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 "IMPRIMIR"
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").Selecionado = 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]").pressione

Next i
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top