Shaxda tusmada
Tababarkan gaaban wuxuu sharxayaa sida loo tirtiro saf kasta oo Excel ah iyadoo la shaandheynayo ama koodka VBA. Waxaad sidoo kale baran doontaa sida loo saaro 3rd, 4th ama mid kasta oo safka Nth. > 3>
Waxaa jira xaalado badan marka laga yaabo inaad u baahato inaad tirtirto safafka kale ee xaashida shaqada ee Excel. Tusaale ahaan, waxaa laga yaabaa inaad rabto inaad hayso xogta xitaa toddobaadyo (safka 2, 4, 6, 8, iwm.) oo aad u guurto dhammaan toddobaadyada khayaaliga ah ( safafka 3, 5, 7 iwm.) xaashi kale.
Guud ahaan, tirtirida saf kasta oo Excel ah waxay hoos ugu dhacdaa xulashada safafka kale. Marka safafka la doorto, hal istaroog oo ku yaal badhanka Delete ayaa ah waxa ay qaadanayso. Dheeraad ah oo ku saabsan maqaalkan, waxaad baran doontaa dhowr farsamooyin si aad si dhakhso ah u doorato oo aad u tirtirto mid kasta oo kale ama saf kasta Nth ee Excel.
Sida loo tirtiro saf kasta oo kale oo Excel ah adoo sifeynaya
Nuxur ahaan, habka caadiga ah ee lagu tirtiro saf kasta oo Excel ah waa tan: marka hore, waxaad shaandheysaa safafka kale, ka dibna dooro, oo tirtir dhammaan hal mar. Tallaabooyinka faahfaahsan ayaa raacaya xagga hoose:
- >> Tiir madhan oo ku xiga xogtaada asalka ah, geli isku xigxiga eber iyo kuwa. Waxaad si dhakhso ah taas u samayn kartaa adiga oo ku dhejiya 0 unugga kowaad iyo 1 unugga labaad, ka dib koobiyaynta labada unug ee hore oo ku dheji hoos tiirka ilaa unugga u dambeeya ee xogta leh.
Haddii kale, waxaad isticmaali kartaa qaacidadan:
> =MOD(ROW(),2)
Natiijo ahaan, waxaad haysataa 0 dhammaan safafka (sababtoo ah waxay u qaybsan yihiin 2 siman oo aan ka hadhin) iyo 1 dhammaan safafka khayaaliga ah:
11>
Si taas loo sameeyo, dooro unug kasta oo ku jira tiirka Caawintaada, tag Data tab > Sort and Filter group, oo dhagsii Filter badhanka. Fallaadhaha shaandhada hoos-u-dhaca ayaa ka soo bixi doona dhammaan unugyada madaxa. Waxaad gujisaa badhanka fallaadha ee tiirka Caawinta oo calaamee mid ka mid ah sanduuqyada:
- 0 si aad u tirtirto xataa safafka > 1 si aad u tirtirto safafka khayaaliga ah
Tusaalahan, waxaan ka saareynaa safafka leh "0" qiyamka, si aan u shaandheyno iyaga:
> Hadda oo dhammaan "1" saf waa qarsoon yihiin, dooro dhammaan safafka "0" ee muuqda, midig-guji xulashada oo dhagsii Delete Saf:
>
>>
Natiijadu waxay tahay, toddobaadyada kaliya ayaa ka haray xaashida shaqada, toddobaadyadii qallafsanaa way tageen!
>
Talo. Haddii aad jeclaan lahayd inaad guurto mid kastasafka kale oo meel kale aado intii aad gabi ahaanba tirtiri lahayd, marka hore koobbi safafka la sifeeyay oo ku dheji meel cusub, ka dibna tirtir safafka la sifeeyay.
Sida loo tirtiro safafka kale ee Excel ee leh VBA
Haddii aadan rabin inaad waqtigaaga ku lumiso hawl yar sida tirtiridda saf kasta oo kale ee xaashidaada Excel, VBA macro-ga soo socda ayaa kuu habayn kara nidaamka:
Sub Delete_Alternate_Rows_Excel() Dim SourceRange Sida Range Set SourceRange = Application.Selection Set SourceRange = Application.InputBox("Range:"", "Select the range" Application.ScreenUpdating = Been loogu talagalay RowIndex = SourceRange.Rows.Count - (SourceRange.Rows.Count Mod 2) Ilaa 1 Step -2 Deji FirstCell = SourceRange.Cells(RowIndex, 1) FirstCell.EntireRow.Delete Next Application.ScreenUpdating = Run Dhammaadka Haddii Dhamaadka SubSida loo tirtiro saf kasta oo kale oo Excel ah iyadoo la adeegsanayo makro
I Geli makro xaashidaada shaqo sida caadiga ah adigoo isticmaalaya Visual Basic Editor:
- Riix Alt + F11 si aad u furto daaqada Visual Basic for Applications > Dusha sare ee liiska, dhagsii Insert > Module , oo ku dheji macro-ga sare Module > >Riix furaha F5 si aad u socodsiiso makro.
- Wadahadal ayaa soo baxaya oo ku sheegi doona inaad doorato tiro kala duwan. Dooro miiskaaga oo gujiOK:
>
>
Halkan:
- 9> m waa nambarka safka unugga kowaad ee xogta laga jaray 1
- n waa safka Nth ee aad rabto in aad tirtirto
Aynu nidhaahno xogtaadu waxay ku bilaabataa safka 2aad oo aad rabto inaad tirtirto safkii 3aadba. Marka, qaacidadaada n waxay la mid tahay 3, iyo m waxay la mid tahay 1 ( safka 2 laga jaray 1):
=MOD(ROW() - 1, 3)
Waxa qaacidadu ay qabato waa u qaybi nambarka safka qaraabo ah 3 oo soo celi inta soo hartay qaybinta ka dib. Xaaladeena, waxay soo saartaa eber saf kasta oo seddexaad ah sababtoo ah tir kasta oo seddexaad waxay u qaybisaa 3 iyada oo aan la haynin (3,6,9, iwm):
>
Haddana, adiga Samee tillaabooyinka horey loo yiqiin si aad u shaandheyso "0" saf:
- Dooro unug kasta oo miiskaaga ku jira oo guji Filter badhanka Data >
- Sifee tiirka Caawinta si aad u muujiso kaliya "0" qiyamka.
- Dooro dhammaan safafka "0" ee muuqda, midig-guji oo dooro Tirtir Safka ee macnaha guud.
- Ka saar shaandhada ooTirtir tiirka Caawinta >
>
>Si la mid ah, waxaad tirtiri kartaa saf kasta oo 4th, 5th ama Nth kasta oo Excel ah.Talo. Haddii ay dhacdo in aad u baahato in aad ka saarto safafka xog aan khusayn, casharka soo socda ayaa ku caawin doona: Sida loo tirtiro safafka ku salaysan qiimaha unugga .