Shaxda tusmada
Maqaalkan, waxaad ku baran doontaa sida U dejiso Range unugyada, safafka iyo tiirarka VBA Excel.
>> Soo dejiso Buug-shaqeedka
Waxaad ka soo dejisan kartaa buuga shaqada ee Excel ee bilaashka ah Shayga Range ee VBA > Range ee VBA waxa uu ka koobnaan karaa hal unug, unugyo badan, saf, tiirar gudaha xaashida shaqada ee Excel.
0>Sarkaynta Rangewalaxda waa sida hoos ku qoran.> Codsiga > Buuga shaqada > Xaashida shaqada > Range
>Sidaan waa sida ay tahay inaad ku dhawaaqdo Range shayga VBA .
>>>1>7 Tusaalooyinka ku saabsan sida loo Dejiyo Range gudaha VBA Excel >
>Qaybtani waxay ka hadli doontaa sida loo dejiyo Range hal unug, unugyo badan, hal saf, saf badan, hal tiir, tiirar badan iyo samee kala duwanaansho iyada oo loo marayo Badhanka Amarka ee VBAExcel.> 1> 1. Deji Range gudaha Hal unug gudaha VBA >
> Halkan waxaan ku arki doonaa sida loo Dejinta Rangegudaha hal unugleh VBA.Tallaabooyinka:>- Riix Alt + F11 ee kiiboodhkaaga ama tag tab Horume-> Visual Basic si loo furo Visual Basic Editor .
- Daaqadda koodka soo-boodka ah, ka soo baxa menu-ka , guji Geli -> Module .
- Koofi koodkan soo socda oo ku dheji daaqada koodka >
2834
Halkan,
B2 = unugga meesha aan rabno inaan dhignoqiimaha. Waxaad dejin kartaa lambarka tixraaca unugga ee aad u baahan tahay.
Koodhkaagu hadda wuu diyaar u yahay inuu shaqeeyo.
- >
- Riix F5 kiiboodhkaaga ama barta menu-ka dooro Run -> Orod Sub/Form User . Waxa kale oo aad riixi kartaa ikoonka ciyaarta yar ee ku yaala bar-menu-hoosaadka si aad u socodsiiso makro. >
In ka badan ka sii akhri: >VBA ee unug kasta oo ku jira Range gudaha Excel
2. Deji Range unugyo badan oo VBA ah
> Halkan waxaan ku arki doonnaa sida U dejiso Range gudaha unugyo badan oo leh VBA . >> Tallaabooyinka:
- Si la mid ah sidii hore, fur Tafatiraha Aasaasiga ah ee Muuqaalka laga bilaabo Developer tab iyo Geli a Module ee daaqada koodka. >Daaqadda koodka, koobi koodka soo socda oo dheji.
2311
Koodhkaagu hadda waxa uu diyaar u yahay in uu shaqeeyo.
- Orod makro iyo dhammaan unugyada A1 ilaa D5 hadda hayso " Hello! "
3. Deji Range Safka Keliya ee VBA >
> Halkan waxaan ku arki doonaa sida loo Dejinta Range ee hal saf leh VBA . Tallaabooyinka: >- Si la mid ah sidii hore, ka fur Visual Basic Editor ka Developer tab iyo Geli a Module daaqada koodka >Daaqadda koodka, koobi koodka soo socda oo dheji
2116
Koodhkaaga hadda diyaar ayuu u yahay inuu ordo.
- >
- > Run makro iyokaliya 3rd safafka oo dhan laga bilaabo A1 ilaa D5 hadda hay “ Hello! ”
- > Saf (3) .
4. Deji Range Safafka Badan ee VBA >
> Halkan waxaan ku arki doonaa sida loo Dejiso Range gudaha safaf badan leh VBA .<3Tallaabooyinka:
>- Si la mid ah sidii hore, ka fur Visual Basic Editor ka Developer tab iyo Geli a Module daaqada koodka >Daaqadda koodka, koobi koodka soo socda oo dheji
1274
Koodhkaagu hadda waa diyaar u ah inuu ordo.
- > Orod makro iyo 1aad , 3aad iyo 5aad oo dhan Safafka laga bilaabo A1 ilaa D5 hadda hayaan " Hello! > Akhris la mid ah: >
- >
- > Sida loo Doorto Range Iyada oo ku saleysan Qiimaha Unug ee VBA (7 Siyadood) > 12> Isticmaal Shayga Range ee VBA gudaha Excel Tusaalooyin a hal tiir oo leh VBA .
- Si la mid ah sidii hore, ka fur Visual Basic Editor ka Developer tab iyo Geli a Module gudaha daaqada koodka .
- Daaqadda koodka,koobi ka samee koodka soo socda oo dheji Tiirka 2aad laga bilaabo dhammaan tiirarka A1 ilaa D5 hadda hay “ Hello! ” > 14>
- iCol.Columns(2) .Qiimaha ee koodhka ayaa siisay marin u helka 2nd tiirka tirada gaarka ah A1:D5 .
- Si la mid ah sidii hore, fur Tafatiraha Aasaasiga ah ee Muuqaalka > laga bilaabo Developer tab iyo Geli a Module gudaha daaqadda koodka. >Daaqadda koodka, koobi kood soo socda oo dheji
> Tallaabooyinka:
11>3>
Sidoo kale eeg: Sida cinwaan loogu daro miiska Excel (oo leh Tallaabo Fudud)- >
> 6. U deji Range dhowr tiir oo gudaha VBA >
> Halkan waxaan ku arki doonaa sida loo Dejinta Range gudaha badan tiirarka leh VBA . > >Tallaabooyinka: >
7519
Koodhkaagu hadda waxa uu diyaar u yahay inuu shaqeeyo.
>- Run makro iyo 2nd iyo 4-aad tiirarka laga bilaabo A1 ilaa D5 hadda hayaan " Hello! 7. Deji Range iyada oo loo marayo Badhanka Amarka gudaha VBA > > Halkan waxaan ku baran doonaa sida loo Dejinta Range addoo isticmaalaya Badhanka Amarka gudaha VBA .<3
>Tallaabooyinka: >
>- Tag Developer -> Gali -> Badhanka Amarka .
- Hubi, inaad leedahay Naqshad qaabaynta shidmay 1>jiid agagaarka Badhanka Amarka ee xaashida. >
- >
- >>Laba jeer guji badhanka oo waxay ku geyn doontaa daaqada koodka, oo si toos ah loo soo saaray a code-hoosaadka VBA . >
>
Sidoo kale eeg: Sida loo kooxeeyo miiska Pivot bishiiba Excel (2 qaab)- Gudaha Sub-code, ku qor koodka oo Keydi. 13>
- Ku laabo xaashida shaqada ee xiisaha oo dhagsii Badhanka Amarka . Natiijada ku salaysan koodkaagu waxay ka soo muuqan doontaa xaashida shaqada. >
Aad bay u fududahay in la hirgeliyo.
> - Doodaha gudaha Range ma aha kuwo go'an. Markaa waxaan u bedeli karnaa qiyamka doodda hadba baahidayada >
- In ka badan 1 ayaa loo gudbin karaa dood ahaan
Waxyaabaha la xasuusan karo >
- CELLS guryaha ku jira VBA waxa kale oo loo isticmaali karaa in lagu dejiyo Range gudaha VBA . 12> Doorsoomayaasha shayga waa in loo dejiyaa tixraaca shayga SET > 13>
Gabagabo
> Maqaalkani wuxuu ku tusay sida loo sameeyo Deji Range gudaha Excel VBA macro. Waxaan rajeynayaa in maqaalkani uu faa'iido badan kuu lahaa. Xor baad u tahay inaad waydiiso su'aalo kasta oo ku saabsan mawduuca. - Tag Developer -> Gali -> Badhanka Amarka .