Microsoft Excel Cov Ntaub Ntawv Tso Npe

Los txhim kho cov ntaub ntawv nkag mus rau hauv ib lub rooj nyob hauv Excel, koj tuaj yeem siv cov ntawv tshwj xeeb uas yuav pab kom nce cov txheej txheem ntawm kev ua tiav cov lus qhia nrog cov ntaub ntawv. Nyob rau hauv Excel muaj ib qho cuab yeej built-in uas tso cai rau txhim kho nrog txoj kev zoo sib xws. Tus neeg siv yuav tau tsim nws tus kheej version ntawm daim ntawv, uas yuav ua kom haum rau nws cov kev xav tau los ntawm kev ua ntawv thov rau ib qho kev lag luam. Wb saib ntau yam kev siv rau cov cuab yeej pabcuam no hauv Excel.

Ua ntawv thov cov cuab yeej

Daim ntawv filling yog ib qho khoom nrog lub teb uas nws lub npe sib raug zoo rau cov npe ntawm cov kab ntawm cov lus. Hauv cov hauj lwm no koj yuav tsum nkag mus rau cov ntaub ntawv thiab lawv yuav muab tam sim ntawd ntxiv rau txoj kab tshiab nyob rau hauv cov txheej txheem. Ib daim ntawv ua tau los ua tus cuab yeej Excel tsim, los yog muab tso ncaj qha rau ntawm ib daim ntawv hauv nws daim duab, yog tias nws tsim los ntawm tus neeg siv nws tus kheej.

Tam sim no cia saib seb yuav siv ob hom kev siv li cas.

Method 1: Excel tus txheej txheem ntawm cov ntaub ntawv nkag tsev

Ua ntej tshaj, cia peb kawm tau siv cov ntaub ntawv hauv Excel nkag.

  1. Nws yuav tsum tau muab sau tseg tias yog lub vas sab uas nws pib tshwm sim thiab yuav tsum tau qhib. Ua li no, mus rau lub tab "Cov Ntaub Ntawv"thiab tom qab ntawd nias rau yam khoom ntawd "Kev xaiv".
  2. Hauv Excel qhib cov qhov rai qhib peb mus rau seem "Ceev Ntaub Toolbar". Feem ntau ntawm cov qhov rais yog nyob ntawm thaj chaw ntau qhov chaw. Nyob rau hauv sab laug ntawm nws yog cov cuab yeej uas yuav muab ntxiv rau pawg nkag yooj yim, thiab nyob rau hauv txoj cai - cov khoom qub twb tuaj lawm.

    Hauv teb "Xaiv pawg los ntawm" teev tus nqi "Cov puav pheej tsis nyob rau daim kab xev". Tom ntej no, los ntawm daim ntawv teev cov lus txib nyob rau hauv cov lus cim npe, peb pom thiab xaiv txoj haujlwm "Daim ntawv ...". Ces nyem rau ntawm lub pob "Ntxiv".

  3. Tom qab ntawd, cov cuab yeej peb xav tau yuav tshwm nyob sab xis ntawm lub qhov rais. Peb nias lub khawm "OK".
  4. Tam sim no qhov cuab tam no nyob rau hauv lub qhov rais Excel rau kev ceev toolbar, thiab peb siv tau nws. Nws yuav tsum tuaj thaum muaj ib phau ntawv raug qhib los ntawm qhov ua piv txwv ntawm Excel.
  5. Tam sim no, nyob rau hauv kev txiav txim rau lub cuab tam kom to taub tias nws xav tau dab tsi raws nraim, koj yuav tsum tau kho cov lus ntawm lub rooj thiab sau cov nqi ntawm nws. Cia lub rooj tuaj txog peb yuav muaj plaub kab, uas muaj cov npe "Cov khoom npe", "Quantity", "Nqe" thiab "Tus nqi". Nkag mus rau cov npe no hauv ib qho kev hloov ntawm cov ntawv.
  6. Kuj, qhov kev txiav txim siab rau qhov kev zov me nyuam kom to taub qhov twg yog qhov tshwj xeeb nws yuav tsum tau ua hauj lwm nrog, koj yuav tsum nkag mus rau cov nqi hauv thawj kab ntawm rooj lus.
  7. Tom qab ntawd, xaiv tej lub xovtooj ntawm lub rooj voj voog thiab nias ntawm lub cim nyob rau hauv cov chaw ceev ntaub ntawv "Daim ntawv ..."uas peb tau ua dhau los.
  8. Yog li ntawd, lub qhov rais ntawm qhov kev pom zoo siv qhib. Raws li koj tau pom, cov khoom no muaj cov teb uas sib haum rau cov npe ntawm txhua kab ntawm peb cov rooj ua ke. Hauv qhov no, thawj teb yog twb tau sau nrog tus nqi, vim peb nkag mus rau ntawm nws daim ntawv.
  9. Nkag mus rau qhov tseem ceeb uas peb xav tau tsim nyog rau hauv cov seem hauv qab, ces nyem rau ntawm lub pob "Ntxiv".
  10. Tom qab ntawd, raws li peb pom, cov nqi nkag tau hloov mus rau thawj kab ntawm lub rooj, thiab daim ntawv mus rau tom ntej thaiv ntawm cov cheeb tsam, uas sib haum mus rau kab thib ob ntawm rooj zaum.
  11. Sau cov cuab yeej qhov rai nrog qhov tseem ceeb uas peb xav pom hauv ob kab hauv tablespace, thiab nias lub pob dua. "Ntxiv".
  12. Raws li koj tau pom, qhov tseem ceeb ntawm tus kab thib ob kuj tau ntxiv, thiab peb twb tsis tau hloov dua tus cursor hauv lub rooj ua nws tus kheej.
  13. Yog li, peb sau cov lus array nrog txhua qhov tseem ceeb uas peb xav nkag rau hauv.
  14. Tsis tas li ntawd, yog tias xav tau, koj tuaj yeem los ntawm cov nqi nkag uas siv yav dhau los uas siv cov nyees khawm "Rov qab" thiab "Tom ntej" los yog ntsug scrollbar.
  15. Yog tias tsim nyog, koj tuaj yeem hloov kho cov nqi hauv cov rooj zaum los ntawm kev hloov hauv daim ntawv. Hauv kev txiav txim rau cov kev hloov tshwm nyob rau hauv daim ntawv, tom qab txiav txim siab mus rau hauv cov cuab yeej tsim nyog, nias lub khawm "Ntxiv".
  16. Raws li koj tau pom, qhov kev hloov tam sim ntawd tshwm sim hauv daim ntawv qhia tawm.
  17. Yog tias peb xav rho tawm ib co kab, ces los ntawm cov khoom khawm navigation los sis thij sab, peb npaj mus rau qhov chaw tiv thaiv ntawm daim teb. Tom qab ntawd nias ntawm khawm "Rho tawm" hauv qhov rai qhov rai.
  18. Lub dialog box qhib ceeb toom, qhia tias cov kab yuav muab deleted. Yog tias koj muaj kev ntseeg siab rau koj cov yeeb yam, ces nias lub khawm "OK".
  19. Raws li koj tau pom, txoj kab twb muab rho tawm los ntawm lub rooj sib tham. Tom qab qhov kev txhim kho thiab kev kho tiav, koj tuaj yeem tawm tau qhov cuab yeej qhov rai los ntawm qhov khawm. "Kaw".
  20. Tom qab ntawd, thiaj li ua tau lub rooj array ntau qhov muag, koj tuaj yeem tsim nws.

Method 2: Tsim ib daim ntawv kev cai

Ntxiv rau, siv cov macro thiab ntau yam cuab yeej, nws tsim nyog los tsim koj tus kheej kev cai sau rau hauv ib daim ntawv qhia tawm. Nws yuav raug tsim ncaj qha rau ntawm daim ntawv, thiab sawv cev rau nws ntau. Nrog rau qhov cuab yeej no, tus neeg siv nws tus kheej yuav tsum paub txog cov nta uas nws pom tias tsim nyog. Nyob rau hauv cov nqe lus ntawm functionality, nws yuav xyaum tsis tau inferior rau cov analog built-in analogue ntawm Excel, thiab nyob rau hauv ib co txoj kev, tej zaum, tshaj nws. Tsuas yog qhov teeb meem ntawm txhua lub rooj, koj yuav tsum tsim kom tau ib daim ntawv sib txawv, thiab tsis siv tib lub qauv li yog thaum siv tus qauv version.

  1. Raws li hauv txoj kev ua ntej, thawj zaug ntawm txhua yam, koj yuav tsum ua kom tau ib lub taub hau ntawm lub rooj tom ntej rau ntawm daim ntawv. Nws yuav muaj tsib lub hlwb nrog cov npe: "P / p tus xov tooj", "Cov khoom npe", "Quantity", "Nqe", "Tus nqi".
  2. Tom ntej no koj yuav tsum ua ib lub npe hu ua "ntse" los ntawm peb cov rooj ua ke, nrog kev muaj peev xwm cia ntxiv cov kab thaum sau daim ntawv sib txawv nyob rau hauv los yog hlwb nrog cov ntaub ntawv. Ua li no, xaiv lub hau thiab, nyob hauv tab "Tsev"nias lub khawm "Hom ntawv raws li rooj" nyob rau hauv lub block ntawm cov cuab yeej "Yeej". Tom qab hais tias muaj cov npe muaj qhib muaj lub npe. Cov kev xaiv ntawm ib leeg yuav tsis cuam tshuam rau cov kev ua haujlwm hauv txhua txoj kev, yog li peb tsuas xaiv qhov kev xaiv uas peb xav tias tsim nyog.
  3. Tom qab ntawd lub qhov rooj me me qhib lub qhov rais. Nws qhia txog qhov uas peb tau pom yav dhau los, uas yog, qhov khwv ntawm lub hau. Raws li txoj cai, lub tshav pob no tau sau rau hauv qhov tseeb. Tiam sis peb yuav tsum khij lub npov ntawm ib sab "Cov lus nrog lub npe". Tom qab ntawd, nyem rau ntawm lub pob "OK".
  4. Yog li, peb cov kab no yog formatted ua ib lub rooj ntse, txawm tias muaj kev hloov hauv kev pom duab. Raws li koj tau pom, nrog rau lwm yam, filtering icons tshwm nyob ze ntawm txhua kem npe. Lawv yuav tsum tsis taus. Ua li no, xaiv ib lub xov tooj ntawm tes hauv "ntse" lub rooj thiab mus rau lub tab "Cov ntaub ntawv". Muaj nyob rau hauv daim kab xev hauv lub nras cov cuab yeej "Tsi thiab lim" nyem rau ntawm lub cim "Lim".

    Muaj lwm txoj hau kev lov tes taw lub lim. Koj tsis txawm yuav hloov mus rau lwm tab, thaum uas tseem tshuav nyob hauv tab "Tsev". Tom qab koj xaiv lub xovtooj ntawm cov qauv ntawm daim ntawv sau rau hauv qhov chaw thaiv Editing nyem rau ntawm lub cim "Tsi thiab lim". Hauv daim ntawv uas tshwm sim, xaiv qhov chaw "Lim".

  5. Raws li koj tuaj yeem pom, tom qab qhov kev ua no, cov cim kev tshawb fawb los ntawm lub rooj xa, raws li kom ua.
  6. Tom qab ntawd peb yuav tsum tsim cov ntaub ntawv nkag teb chaws nws tus kheej. Nws kuj yuav yog ib hom kev tabular uas muaj ob kab ntawv. Cov kab npe ntawm cov khoom no yuav sib haum mus rau cov npe ntawm lub rooj. Qhov kos yog txhua kab "P / p tus xov tooj" thiab "Tus nqi". Lawv yuav tsis tuaj. Tus lej ntawm thawj tus yuav tshwm sim los ntawm kev siv lub tswv yim, thiab qhov muab xam ntawm qhov tseem ceeb hauv ob yuav ua tiav los ntawm kev thov cov qauv ntawm cov nqi ntau.

    Daim ntawv thib ob ntawm cov ntaub ntawv nkag teb chaws tshuav dawb paug rau tam sim no. Ncaj qha, qhov tseem ceeb rau kev sau cov kab ntawm lub rooj sib txawv loj yuav raug muab tso rau hauv nws tom qab.

  7. Tom qab ntawd peb tsim lwm lub rooj me me. Nws yuav muaj ib kem thiab nws yuav muaj ib daim ntawv teev cov khoom uas peb yuav muab tso rau hauv ob sab ntawm lub rooj loj. Rau clarity, lub xovtooj ntawm nrog lub npe ntawm daim ntawv ("Daim ntawv teev cov khoom") koj tuaj yeem sau nrog rau xim.
  8. Tom qab ntawd xaiv thawj npliag cell ntawm tus nqi khoom input. Mus rau lub tab "Cov ntaub ntawv". Ndliv qhov icon "Cov Ntaub Ntawv Qhia Tias"uas yog muab tso rau ntawm daim kab xev hauv lub nras cov cuab yeej "Ua hauj lwm nrog cov ntaub ntawv".
  9. Lub tswv yim pib ntawm qhov kev pib nkag pib. Nias ntawm daim teb "Hom ntaub ntawv"nyob rau hauv uas lub chaw default yog "Tej nqi".
  10. Los ntawm cov kev xaiv qhib, xaiv qhov chaw "Sau".
  11. Raws li koj tau pom, tom qab no, qhov ntsuas qhov ntsuas qhov rai hloov nws txoj kev teeb tsa. Muaj dua lwm daim teb "Tau qhov twg los". Peb nias ntawm lub cim mus rau sab xis ntawm sab laug nas khawm.
  12. Ces qhov ntsuas qhov ntsuas qhov rais yog qhov tsawg. Xaiv tus cursor nrog tus nas laug khawm tuav cov npe ntawm cov ntaub ntawv uas muab tso rau ntawm daim ntawv nyob hauv thaj chaw ntxiv. "Daim ntawv teev cov khoom". Tom qab ntawd, rov nyem dua rau ntawm lub cim mus rau sab xis ntawm lub tshav puam uas qhov chaw nyob ntawm cov kev xaiv tau tshwm sim.
  13. Rov qab mus rau ntawm lub thawv rau cov nqi nkag. Raws li koj tau pom, tus saib xyuas ntawm cov kev xaiv hauv nws tau tshwm sim nyob rau tom teb "Tau qhov twg los". Ndliv lub khawm "OK" nyob hauv qab ntawm qhov rais.
  14. Tam sim no tus cim nyob rau hauv daim ntawv ntawm ib daim duab peb sab los ntawm sab xis ntawm qhov tseem ceeb npliag hlwb ntawm cov ntaub ntawv nkag teb chaws. Thaum twg koj nias rau ntawm nws, yuav qhib ib daim npe sau npe, uas muaj cov npe uas rub tawm los ntawm ib lub rooj sablaj. "Daim ntawv teev cov khoom". Cov ntaub ntawv khaws cia hauv xov tooj ntawm tes yog tam sim no tsis tuaj yeem nkag mus, tab sis koj tsuas yog xaiv tau txoj hauj lwm yam xav tau los ntawm cov npe. Xaiv cov khoom hauv daim ntawv teev npe cia.
  15. Raws li koj tau pom, qhov chaw uas tau xaiv tau tshwm sim nyob rau tom teb "Cov khoom npe".
  16. Tom ntej no, peb yuav tsum tau tso npe rau peb lub hlwb ntawm lub tswv yim, qhov uas peb yuav nkag mus rau cov ntaub ntawv. Xaiv tus thawj lub xovtooj uas lub npe yog twb tau teev nyob rau hauv peb cov ntaub ntawv. "Qos yaj ywm". Tom ntej no, mus rau lub npe ntawm lub npe. Nws nyob ntawm sab laug ntawm lub qhov rais Excel ntawm tib theem li ntawm qhov formula bar. Nkag mus rau ntawm lub npe no. Qhov no yuav ua tau lub npe hauv Latin, uas tsis muaj qhov chaw, tab sis nws yog qhov zoo uas siv cov npe ze ntawm cov dej num uas tau los ntawm cov ntawv no. Vim li no, thawj tus xovtooj uas lub npe ntawm cov khoom yog muaj npe hu ua "Lub npe". Peb sau lub npe no nyob rau tom teb thiab nias lub ntsiab Sau ntawm cov keyboard.
  17. Ua raws nraim tib txoj kev, cob lub xov tooj ntawm tes uas peb nkag mus rau qhov ntau ntawm cov khoom, lub npe "Volum".
  18. Thiab tus nqi ntawm tes yog "Nqe".
  19. Tom qab ntawd, nyob rau hauv tib yam nkaus, peb muab lub npe rau tag nrho ntawm cov saum toj no peb lub hlwb. Ua ntej tshaj plaws, xaiv, thiab muab nws lub npe rau hauv ib lub teb tshwj xeeb. Cia nws yog lub npe "Diapason".
  20. Tom qab qhov kawg, peb yuav tsum txuag tau daim ntawv kom peb cov npe uas peb yuav pom tau qhov macro uas peb tau tsim yav tom ntej. Kom txuag, mus rau lub tab "Cov Ntaub Ntawv" thiab nias rau yam khoom ntawd "Txuag Raws Li ...".
  21. Nyob rau hauv qhib lub qhov rais qhib tom teb "Cov Ntaub Ntawv Siv" xaiv tus nqi "Macro-Enabled Excel Workbook (.xlsm)". Tom ntej no, nias lub khawm "Txuag".
  22. Tom qab ntawd koj yuav tsum qhib macros rau hauv koj version of Excel thiab pab kom tab "Tsim tawm"yog hais tias koj tsis tau ua nws tsis tau. Qhov tseeb yog tias ob yam ntawm cov haujlwm no yog neeg xiam oob khab los ntawm qhov kev pab cuam, thiab lawv yuav tsum ua kom tau los ntawm kev quab yuam hauv Excel qhov chaw.
  23. Thaum koj ua tiav qhov no, mus rau lub tab "Tsim tawm". Nias ntawm qhov loj icon "Nrig txog kev pom tseeb"uas yog nyob rau ntawm daim kab xev hauv lub nras cov cuab yeej "Txoj Cai".
  24. Qhov kawg ua rau VBA macro editor pib. Hauv thaj chaw "Qhov project"uas yog nyob hauv sab laug sab laug ntawm lub qhov rais, xaiv lub npe ntawm daim ntawv uas peb cov rooj nyob yog nyob. Hauv no nws yog "Ntawv 1".
  25. Tom qab ntawd mus rau sab laug hauv qab ntawm lub qhov rais hu ua "Cov khoom". Ntawm no yog cov chaw ntawm daim ntawv xaiv. Hauv teb "(Npe)" yuav tsum hloov lub npe Cyrillic ("Sheet1") ntawm lub npe sau ua lus Mev. Lub npe yuav muab rau leej twg uas yooj yim rau koj, qhov tseem ceeb tshaj plaws yog tias nws tsuas muaj cov cim Latin lossis cov zauv thiab tsis muaj lwm yam cim lossis chaw. Lub macro yuav ua haujlwm nrog lub npe no. Cia peb nyob hauv peb lub npe no "Khoom", txawm tias koj tuaj yeem xaiv lwm tus uas muaj raws li cov kev qhia hauv qab no.

    Hauv teb "Lub npe" Koj tuaj yeem hloov lub npe nrog ib qho yooj yim dua. Tab sis nws tsis tsim nyog. Hauv qhov no, kev siv tej qhov chaw, Cyrillic thiab lwm yam cim raug tso cai. Tsis zoo li yav dhau los parameter, uas qhia meej lub npe ntawm daim ntawv rau qhov kev zov me nyuam, qhov kev ntsuas no muab lub npe rau daim ntawv uas pom tau rau tus neeg siv nyob rau hauv lub khawm shortcut.

    Raws li koj tau pom, tom qab ntawd lub npe yuav cia li hloov. Sheet 1 nyob rau hauv cheeb tsam "Qhov project", mus rau ib qho peb cia li teem nyob rau hauv qhov chaw.

  26. Ces mus rau ntawm thaj chaw hauv lub qhov rais. Qhov no yog qhov uas peb yuav tsum sau cov ntawv code ntawm nws tus kheej. Yog hais tias qhov kev cai code editor dawb hauv cheeb tsam teev lus qhia tsis yog tso tawm, raws li nyob rau hauv peb cov ntaub ntawv, ces nias rau ntawm qhov tseem ceeb muaj nuj nqi. F7 thiab nws yuav tshwm sim.
  27. Tam sim no rau peb cov piv txwv, peb yuav tsum sau cov cai hauv qab no:


    Sub DataEntryForm ()
    Dim nextRow kom ntev
    nextRow = Producty.Cells (Producty.Rows.Count, 2) .End (xlUp) .Offset (1, 0) .Row
    Nrog Producty
    Yog "Range" ("A2"). Tus nqi = "" thiab "Range" ("B2").
    nextRow = nextRow - 1
    Xaus yog
    Producty.Range ("Lub Npe")
    .Cells (nextRow, 2) .PasteSpecial Paste: = xlPasteValues
    .Cells (nextRow, 3) .Value = Producty.Range ("Volum")
    .Cells (nextRow, 4) .Value = Producty.Range ("Nqe")
    .Cells (nextRow, 5) .Value = Producty.Range ("Volum") Tus nqi * Producty.Range ("Nqe").
    ("A2"). Formula = "= IF (ISBLANK (B2)," "", COUNTA ($ B $ 2: B2)) "
    Yog nextRow> 2 Ces
    Ntau ("A2"). Xaiv
    Xaiv mus rau AutoFill: = Range ("A2: A" & nextRow)
    Ntau ("A2: A" & nextRow) .Txais
    Xaus yog
    .Range ("Diapason"). ClearContents
    Xaus nrog
    Kawg kawg

    Tab sis txoj cai no tsis yog universal, uas yog, nws tseem si tau li qub rau peb cov ntaub ntawv. Yog hais tias koj xav kom hloov nws mus rau koj xav tau kev pab, ces nws yuav tsum tau hloov raws li. Yog li ntawd koj tuaj yeem ua koj tus kheej, cia peb tshawb xyuas cov cai no muaj dab tsi, dab tsi yuav tsum tau hloov rau hauv nws, thiab tsis tas hloov dab tsi.

    Yog li, thawj kab:

    Sub DataEntryForm ()

    "DataEntryForm" yog lub npe ntawm qhov nws tus kheej. Koj tuaj yeem tawm tau nws raws li nws, los yog koj tuaj yeem hloov nrog lwm tus uas ua raws li txoj cai dav dav rau tsim cov npe ntawm cov npe (tsis muaj chaw, siv cov tsiaj ntawv ntawm Latin cov ntawv, thiab lwm yam). Hloov lub npe tsis cuam tshuam dab tsi.

    Qhov twg lo lus pom nyob hauv qhov chaws "Khoom" koj yuav tsum tau hloov nrog lub npe uas koj tau muab rau koj daim ntawv hauv thaj chaw "(Npe)" thaj chaw "Cov khoom" macro editor. Lawm, qhov no yuav tsum tau ua yog tias koj hu ua daim ntawv txawv.

    Tam sim no xav txog cov kab hauv qab no:

    nextRow = Producty.Cells (Producty.Rows.Count, 2) .End (xlUp) .Offset (1, 0) .Row

    Ntaus "2" nyob rau hauv kab no txhais tau tias ob kem ntawm daim ntawv. Nws yog nyob rau hauv kab no uas kem yog "Cov khoom npe". Raws li nws yuav suav cov naj npawb ntawm cov kab. Yog li, yog tias hauv koj rooj plaub tib sab muaj ib qho txawv ntawm tus as khauj, ces koj yuav tsum nkag mus rau tus xov tooj. Lub ntsiab lus "Kawg (xlUp) .Offset (1, 0) .Row" nyob rau hauv txhua rooj plaub, tawm hauv unchanged.

    Tom ntej, xav txog kab

    Yog "Range" ("A2"). Tus nqi = "" thiab "Range" ("B2").

    "A2" - Cov no yog cov thawj ntawm cov thawj ntawm tes uas tus lej muab tso tawm kom pom. "B2" - Cov no yog qhov chaw tus thawj ntawm tes, uas yuav siv rau cov ntaub ntawv tso tawm ("Cov khoom npe"). Yog tias lawv txawv, nkag mus rau koj cov ntaub ntawv es tsis txhob ua cov hauj lwm no.

    Mus rau kab

    Producty.Range ("Lub Npe")

    Hauv nws tus parameter "Lub npe" txhais tau hais tias lub npe peb tau muab rau tom teb "Cov khoom npe" hauv daim ntawv xa tawm.

    Hauv kab


    .Cells (nextRow, 2) .PasteSpecial Paste: = xlPasteValues
    .Cells (nextRow, 3) .Value = Producty.Range ("Volum")
    .Cells (nextRow, 4) .Value = Producty.Range ("Nqe")
    .Cells (nextRow, 5) .Value = Producty.Range ("Volum") Tus nqi * Producty.Range ("Nqe").

    npe "Volum" thiab "Nqe" txhais tau hais tias cov npe peb tau muab rau lub teb "Quantity" thiab "Nqe" nyob hauv tib daim ntawv xa tawm.

    Nyob rau tib txoj kab uas peb tau hais saum toj no, cov zauv "2", "3", "4", "5" txhais tias cov kab zauv ntawm cov ntawv Excel sib thooj rau txhua kab "Cov khoom npe", "Quantity", "Nqe" thiab "Tus nqi". Yog li, yog tias hauv koj rooj plaub lub rooj txav, ces koj yuav tsum qhia kom meej cov kab ntawv sib thooj. Yog hais tias muaj ntau kab, ces los ntawm qhov sib piv koj yuav tsum ntxiv nws cov kab rau txoj cai, yog tias nws tsawg dua, ces tshem tawm cov khoom ntxiv.

    Cov kab ntau ntxiv cov khoom ntawm lawv cov nqi:

    .Cells (nextRow, 5) .Value = Producty.Range ("Volum") Tus nqi * Producty.Range ("Nqe").

    Qhov tshwm sim, raws li peb pom los ntawm cov syntax ntawm cov ntaub ntawv, yuav muab tso rau hauv kem thib tsib ntawm cov ntawv Excel.

    Nyob rau hauv qhov kev qhia no, cov kab no yuav tau suav cov lej:


    Yog nextRow> 2 Ces
    Ntau ("A2"). Xaiv
    Xaiv mus rau AutoFill: = Range ("A2: A" & nextRow)
    Ntau ("A2: A" & nextRow) .Txais
    Xaus yog

    Txhua qhov tseem ceeb "A2" txhais tias qhov chaw nyob ntawm thawj lub xovtooj uas tus lej yuav tsum tau ua, thiab lub koomhaum "Ib qho " - chaw nyob ntawm tag nrho cov sab nraud nrog numbering. Kuaj seb qhov naj npawb yuav tshwm nyob rau hauv koj lub rooj thiab hloov cov koog cev hauv qhov chaws, yog tias tsim nyog.

    Cov kab no muab cov ntaub ntawv nkag teb chaws rho tawm tom qab cov lus qhia ntawm nws tau raug xa mus rau ntawm rooj lawm:

    .Range ("Diapason"). ClearContents

    Nws tsis yog nyuaj rau twv tias ("Diapason") txhais tau tias lub npe ntawm qhov ntau uas peb tau muab rau cov teb rau cov ntaub ntawv nkag. Yog tias koj muab lawv lub npe txawv, ces nws yuav tsum muab tso rau hauv kab no.

    Tus so ntawm txoj cai yog universal thiab txhua tus neeg mob yuav tsum tsis hloov.

    Tom qab koj tau sau cov ntaub ntawv sau tawm hauv qhov rais qhib, koj yuav tsum nias ntawm qhov txuag raws li lub cim icon hauv lub qhov rais sab nrauv. Tom qab ntawd koj tuaj yeem kaw nws los ntawm kev txhaj rau tus khawm txheem kom kaw qhov rais nyob rau sab qaum txoj cai.

  28. Tom qab ntawd, rov qab mus rau cov ntawv Excel. Tam sim no peb yuav tsum tso tus khawm uas yuav qhib lub tswv yim tsim. Ua li no, mus rau lub tab "Tsim tawm". Nyob hauv lub thawv ntawv "Kev Tswj" nyob rau hauv daim kab xev nyem rau ntawm lub pob Muab tshuaj txhuam. Ib daim ntawv teev cov cuab yeej qhib. Nyob rau hauv ib pawg ntawm cov cuab yeej Daim Ntawv Xaiv Tsa xaiv tus thawj heev - "Khawm".
  29. Ces nrog rau sab laug nas khawm tuav, peb mus ncig thaj chaw uas peb xav tso Macro tua khawm, uas yuav hloov cov ntaub ntawv los ntawm daim ntawv mus rau lub rooj.
  30. Tom qab lub voj voog ncig, tso tus nas khawm. Tom qab ntawd lub qhov rais rau qhov muab lub macro rau tus kwv txais pib. Yog hais tias siv ntau lub macros siv nyob rau hauv koj phau ntawv, ces xaiv los ntawm daim ntawv teev npe lub npe ntawm ib qho uas peb tsim saum toj no. Peb hu nws "DataEntryForm". Tab sis qhov no, qhov macro yog ib qho, yog li xaiv nws thiab nias rau khawm "OK" nyob hauv qab ntawm qhov rais.
  31. Tom qab ntawd, koj tuaj yeem lub npe khawm li koj xav tau, tsuas yog xaiv nws lub npe tam sim no.

    Nyob rau hauv peb cov ntaub ntawv, piv txwv li, nws yuav muaj logical muab nws lub npe "Ntxiv". Rename thiab nias nrog nas ntawm txhua lub xovtooj dawb ntawm daim ntawv.

  32. Li ntawd, peb daim ntawv no yog npaj tiav. Kos seb nws ua haujlwm li cas. Nkag mus rau qhov tseem ceeb uas tsim nyog rau hauv nws lub teb thiab nias rau ntawm lub pob. "Ntxiv".
  33. Raws li koj pom, qhov tseem ceeb yog tsiv mus rau ntawm lub rooj, kab sab nraud tau txais ib tug naj npawb, tus nqi xam los ntawm daim teb no yog cleared.
  34. Rov qab sau daim ntawv thiab nias rau lub pob. "Ntxiv".
  35. Raws li koj tau pom, kab thib ob kuj tau ntxiv rau cov lus rooj. Qhov no txhais tau hais tias lub cuab yeej ua haujlwm.

Saib kuj:
Yuav ua li cas los ua tus macro hauv Excel
Yuav ua li cas los tsim ib lub pob hauv Excel

Hauv Excel, muaj ob txoj hauv kev siv daim ntawv sau cov ntaub ntawv: built-in thiab neeg siv. Kev siv ntawm tus qauv siv built-in yuav tsum tau siv zog tsawg kawg ntawm tus neeg siv. Nws yeej ib txwm yog pib los ntawm kev ntxiv qhov sib cov duab icon rau qhov ceev ntawv toolbar. Koj yuav tsum tsim ib daim ntawv kev cai rau koj tus kheej, tab sis, yog tias koj muaj kev vam meej hauv VBA chaws, koj tuaj yeem ua qhov cuab yeej no yoog raws thiab tsim nyog rau koj cov kev xav tau.