Yuav Sau Li Cas Macro yooj yim hauv Microsoft Excel (nrog Duab)

Cov txheej txheem:

Yuav Sau Li Cas Macro yooj yim hauv Microsoft Excel (nrog Duab)
Yuav Sau Li Cas Macro yooj yim hauv Microsoft Excel (nrog Duab)

Video: Yuav Sau Li Cas Macro yooj yim hauv Microsoft Excel (nrog Duab)

Video: Yuav Sau Li Cas Macro yooj yim hauv Microsoft Excel (nrog Duab)
Video: yuav tau tsim kho tus kheej lub neej thiaj yuav vam meej tau 2024, Kaum ib hlis
Anonim

Qhov wikiHow no qhia koj li cas los tsim cov lej yooj yim rau Excel daim ntawv nthuav qhia.

Kauj ruam

Ntu 1 ntawm 3: Pab kom Macros

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 1
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 1

Kauj Ruam 1. Khiav Excel

Koj tuaj yeem ua cov txheej txheem tib yam los pab kom macros hauv Excel 2010, 2013, thiab 2016. Muaj qhov sib txawv me ntsis hauv Excel rau Mac, uas tau piav qhia hauv qab no.

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 2
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 2

Kauj ruam 2. Nyem rau File tab

Ntawm Mac, nyem rau "Excel" ntawv qhia zaub mov

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 3
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 3

Kauj Ruam 3. Nyem Xaiv

Ntawm Mac, nyem qhov "Nyiam" xaiv

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 4
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 4

Kauj Ruam 4. Nyem rau Customize Ribbon xaiv

Ntawm Mac, nyem "Ribbon & Toolbar" hauv ntu "Authoring"

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 5
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 5

Kauj Ruam 5. Kos rau lub npov tsim tawm hauv cov npe ntawm sab xis

Ntawm Mac, koj tuaj yeem pom "Tus Tsim Tawm" hauv "Tab lossis Pawg Npe" npe

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 6
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 6

Kauj Ruam 6. Nyem OK

Tus tsim tawm tab yuav tshwm nyob rau qhov kawg ntawm cov npe tab.

Ntu 2 ntawm 3: Kaw Macros

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 7
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 7

Kauj Ruam 1. Xyaum ua ntu ntu macro

Thaum kaw lub macro, txhua yam nyem lossis ua tiav yog kaw. Yog li, ib qho yuam kev tuaj yeem ua puas txhua yam. Ua qhov kev coj ua ntawm kev sau cov lus txib ob peb zaug yog li koj tuaj yeem ua nws yam tsis muaj kev poob siab thiab tsis muaj qhov nyem tsis raug.

Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 8
Sau ib qho yooj yim Macro hauv Microsoft Excel Kauj Ruam 8

Kauj Ruam 2. Nyem rau Tus Tsim Tawm tab

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 9
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 9

Kauj Ruam 3. Nyem Sau Macro

Qhov kev xaiv no nyob hauv ntu Code ntawm Excel's ribbon. Koj tseem tuaj yeem pib qhov tshiab macro los ntawm nias Alt+T+M+R yuam sij (Windows nkaus xwb).

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 10
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 10

Kauj Ruam 4. Npe lub macro

Siv lub npe paub tau yooj yim, tshwj xeeb tshaj yog tias koj xav tsim ntau macros.

Koj tseem tuaj yeem muab cov lus piav qhia los piav qhia txog kev ua haujlwm ntawm macro

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 11
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 11

Kauj Ruam 5. Nyem rau Shortcut key field

Koj tuaj yeem tsim cov keyboard luv kom cov macro tuaj yeem ua haujlwm tau yooj yim. Txawm li cas los xij, qhov no yog nyob ntawm yeem.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 12
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 12

Kauj Ruam 6. Nias Shift qhov tseem ceeb thiab tsab ntawv

Cov keyboard ua ke ntawm Ctrl+⇧ Ua haujlwm+tsab ntawv yuav raug tsim los khiav cov lej.

Hauv Mac khoos phis tawj, cov keyboard ua ke yog Opt+⌘ Command+tsab ntawv

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 13
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 13

Kauj Ruam 7. Nyem rau Store Macro hauv cov ntawv qhia zaub mov

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 14
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 14

Kauj Ruam 8. Nyem rau qhov chaw uas koj xav khaws cov macro

Yog tias qhov loj tsuas yog siv rau daim ntawv nthuav tawm ntawm qhov no, tawm nws qhov chaw nyob hauv "Phau Ntawv Qhia Ua Haujlwm no". Yog tias koj xav kom siv macro rau txhua daim ntawv teev npe uas koj ua haujlwm nrog, xaiv "Personal Macro Workbook".

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 15
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 15

Kauj ruam 9. Nyem OK

Macro yuav pib kaw.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 16
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 16

Kauj Ruam 10. Ua cov lus txib uas koj xav sau

Txhua yam koj ua ntawm qhov no yuav raug kaw thiab ntxiv rau qhov macro. Piv txwv li, yog tias koj siv cov lej sib npaug A2 thiab B2 hauv cell C7, Excel yuav ntxiv A2 thiab B2, thiab tom qab ntawd tso tawm qhov tshwm sim hauv C7 thaum koj khiav lub macro yav tom ntej.

Macros tuaj yeem nyuaj heev, thiab koj tseem tuaj yeem siv lawv los khiav lwm cov haujlwm hauv Office. Thaum cov ntaub ntawv macro, yuav luag txhua yam uas tau ua tiav hauv Excel tau ntxiv rau qhov loj

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 17
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 17

Kauj Ruam 11. Nyem Nthuav Tawm Cov Ntaub Ntawv thaum koj ua tiav

Cov ntaubntawv povthawj siv ntawm macro yuav xaus thiab qhov txiaj ntsig yuav raug cawm.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 18
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 18

Kauj Ruam 12. Txuag cov ntawv hauv hom ntawv uas tau qhib rau mac

Txhawm rau kom macros ciaj sia, koj yuav tsum khaws phau ntawv ua haujlwm hauv Excel hom uas muaj macros qhib:

  • Xaiv cov ntawv qhia zaub mov, tom qab ntawd nyem Txuag.
  • Nyem rau File Type menu hauv qab daim ntawv npe lub npe.
  • Nyem Excel Macro-Enabled Workbook.

Ntu 3 ntawm 3: Siv Macros

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 19
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 19

Kauj Ruam 1. Qhib phau ntawv ua haujlwm uas muaj macros qhib

Yog tias koj kaw cov ntaub ntawv ua ntej qhib lub macro, koj yuav raug hais kom qhib cov ntsiab lus.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 20
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 20

Kauj Ruam 2. Nyem Enable Content

Qhov kev xaiv no yuav tshwm nyob rau sab saud ntawm daim ntawv Excel ntawm Kev Nyab Xeeb Kev Nyab Xeeb bar thaum twg phau ntawv ua haujlwm uas muaj macros qhib tau qhib. Txij li qhov no yog koj li ntaub ntawv, tau kawg koj tuaj yeem ntseeg nws. Txawm li cas los xij, ceev faj thaum qhib cov ntaub ntawv uas muaj lwm tus neeg siv macros qhib.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 21
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 21

Kauj Ruam 3. Ntaus koj qhov luv luv

Yog tias koj xav siv macro, koj tuaj yeem ua nws nrawm los ntawm nias qhov luv uas koj tau tsim.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 22
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 22

Kauj Ruam 4. Nyem rau Macros khawm hauv Tus Tsim Kho tab

Txhua qhov muaj nyob hauv koj daim ntawv nthuav tawm ntawm qhov no yuav raug nthuav tawm.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 23
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 23

Kauj Ruam 5. Nyem qhov macro koj xav khiav

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 24
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 24

Kauj Ruam 6. Nyem rau Khiav khawm

Macro yuav khiav hauv koj lub cell lossis xaiv ntawm qhov no.

Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 25
Sau Macro yooj yim hauv Microsoft Excel Kauj Ruam 25

Kauj Ruam 7. Saib cov lej lej

Yog tias koj xav paub yuav ua li cas macro coding ua haujlwm ntau ntxiv, qhib cov lej macro koj tsim thiab tinker nrog nws cov ntsiab lus:

  • Nyem rau khawm Macros nyob ntawm Tus Tsim Tawm tab.
  • Nyem lub macro koj xav pom.
  • Nyem Kho kom raug.
  • Saib cov lej lej hauv Visual Basic code kho qhov program.

Pom zoo: