Controlling Execution of VBA on Macro Excel

Some VBA procedures star at the top and progress line by line to the bottom. Most of recorded Macros work in this fashion. Sometime it needed to control the flow of routines by skipping over some statements, executing some statements multiple times and testing conditions to determine what the routine does next.

We can use i.e.

  • GoTo statements
  • If-Then construcs
  • Select Case constructs
  • Fo-Next loops
  • Do While loops
  • Do Until loops

In ID :

Beberapa Prosedur VBA memulai eksekusi perintah-perintah dari atas dan berlanjut baris per baris sampai di baris terakhir. Macro yang terekam sebagian besar berlaku seperti hal tersebut. Akan tetapi suatu saat diperlukan untuk mengkontrol aliran dari rutinitas yang ada dengan melompati beberapa pernyataan, mengeksekusi pernyataan beberapa kali dan melakukan pemeriksaan kondisi untuk menentukan rutinitas apa yang akan dilakukan kemudian.

Untuk melakukan hal tersebut dapat digunakan pernyataan-pernyataan tesebut di atas.

No comments: