Geli oo socodsii macros VBA gudaha Excel - hage tallaabo-tallaabo ah

  • La Wadaag Tan
Michael Brown

Tani waa cashar gaaban oo tallaabo-tallaabo ah oo loogu talagalay bilowgayaasha tusinaya sida loogu daro koodhka VBA-ga (Visual Basic for Applications code) buuggaaga shaqada ee Excel oo socodsii makrokan si aad u xalliso hawlahaaga xaashida.

Dadka intooda badan way i jecel yihiin adiguna ma tihid gurus Microsoft Office dhabta ah. Marka, waxaa laga yaabaa inaan ogaanno dhammaan waxyaabaha gaarka ah ee wacitaanka kan ama doorashadaas, mana sheegi karno farqiga u dhexeeya xawaaraha fulinta VBA ee noocyada kala duwan ee Excel. Waxaan u isticmaalnaa Excel qalab ahaan si aan u socodsiino xogtayada la dabaqay.

Ka soo qaad inaad u baahan tahay inaad xogtaada si uun u beddesho. Wax badan baad google galisay oo waxaad heshay VBA macro kaas oo xaliya hawshaada. Si kastaba ha ahaatee, aqoontaada VBA waxay ka tagtaa wax badan oo la rabo. Dareen xor u ah inaad barato tilmaan-tallaabo tallaabo-tallaabo ah si aad u awooddo inaad isticmaasho koodka aad heshay:

    >

Geli code VBA Buugga Shaqada ee Excel

>Tusaale ahaan, waxaanu Waxaad isticmaali doontaa VBA macro si aad uga saarto nasashada xariiqda xaashida shaqada ee hadda.
  1. Ku fur buuggaaga shaqada Excel.
  2. Riix Alt + F11 si aad u furto Visual Basic Editor (VBE).

    11>

    >
  3. > Midig ku dhufo magaca buuggaaga shaqada ee shayga " Project-VBAProject " (oo ku yaal geeska bidix ee sare ee daaqada editor) oo dooro Geli -> Module laga bilaabo liiska macnaha guud.

    >

    > > Nuqul ka soo guuri koodka VBA-da (laga soo bilaabo bogga-webeedka iwm.) oo ku dheji muraayadda midig ee tifaftiraha VBA (" Module1 " daaqada).

    >
  4. 14>Talo: dedeji fulinta makro

    Haddii koodka kaagaVBA macro kuma jiraan sadarradan soo socda bilowga:

    >

    > Codsiga.ScreenUpdating = Been

    > Codsiga khadadka si aad u hesho macro-gaagu si dhakhso leh ugu shaqeeyo (fiiri shaashadaha sare):
      >> Ilaa bilawga koodka, ka dib dhammaan khadadka koodka ee ka bilaabma Dim (haddii ay jiraan maya " Dim " khadadka, ka dibna ku dar isla markiiba Sub line):

      Application.ScreenUpdating = False

      Codsiga. Xisaabinta = xlCalculationManual

      > 9> Ilaa koodka, ka hor Dhammaadka Sub :

      Application.ScreenUpdating = True

      > Codsiga magacyadoodu waxay soo jeedinayaan, dami dib-u-cusboonaysiinta shaashadda oo dib u xisaabinta qaacidooyinka buugga shaqada ka hor inta aanad bilaabin makro.

      Kadib markii koodka la fuliyo, wax walba waa la shidayaa. Natiijo ahaan, waxqabadka ayaa laga kordhiyaa 10% ilaa 500% (ha, makro wuxuu u shaqeeyaa 5 jeer dhakhso ah haddii uu si joogto ah u maamulo waxa ku jira unugyada).

  5. Buuggaaga shaqada u keydi sidii " Buug-shaqeedka macro-enabled ee Excel ".

    Riix Crl + S , dabadeed dhagsii " Maya " ee ku dhex jira " Tilmaamaha soo socda laguma kaydin karo buug-shaqeedka bilaa-la'aanta ah " wada hadalka digniinta.

    <0 >

    Wadaha " Save as " ayaa furmi doona. Dooro " Excel macro-enabled workbook " ka " Save as type " liiska hoos-hoosaadka oo dhagsii badhanka Save .

    >

    19>

  6. >Riix Alt + Q si aad u xidhoDaaqadda tifaftirka oo dib ugu laabo buugaag shaqo

Sida loo maamulo VBA macros ee Excel

Marka aad rabto inaad socodsiiso code VBA ee aad ku dartay sida lagu sharaxay qaybta sare: taabo Alt+F8 si aad u furto wada hadalka " Macro "

ka bacdi ka dooro macro-ga la doonayo liiska "Macro Name" oo dhagsii badhanka "Run".

21>

Michael Brown waa xamaasad tignoolajiyada u heellan oo xiise u leh fududaynta hababka adag iyadoo la adeegsanayo aaladaha software. In ka badan toban sano oo waayo-aragnimo ah oo ku saabsan warshadaha teknoolajiyada, wuxuu ku horumariyay xirfadihiisa Microsoft Excel iyo Outlook, iyo sidoo kale Google Sheets iyo Docs. Blog-ga Michael wuxuu u heellan yahay inuu la wadaago aqoontiisa iyo khibradiisa dadka kale, isagoo siinaya tabo-fudud oo la raaco iyo casharro lagu horumarinayo wax soo saarka iyo hufnaanta. Haddii aad tahay xirfadle khibrad leh ama bilow ah, Michael's blog wuxuu bixiyaa fikrado qiimo leh iyo talooyin wax ku ool ah si aad uga faa'iidaysato qalabkan software-ka ah ee muhiimka ah.