Sida loo alifbeeto tabs ee Excel sida kor iyo hoos u kala horreeyaan

  • La Wadaag Tan
Michael Brown

Tababarku wuxuu muujinayaa sida aad si dhakhso ah ugu kala sooci karto xaashida shaqada ee Excel qaab alifbeeto ah adiga oo isticmaalaya code VBA iyo aaladda maamulaha buuga.

Microsoft Excel waxa ay ku siinaysaa habab fudud oo degdeg ah tiirar ama saf u kala horreeyaan alifbeetada. Laakiin waxaa jira hal hab oo kaliya oo dib loogu habeynayo xaashiyaha shaqada ee Excel - u jiid booska la rabo ee ku yaal baarka tab ee xaashida. Marka ay timaado alifbeetada ku qorista buuga shaqada ee weyn, tani waxay noqon kartaa hab dheer oo khaldan. Ma waxaad raadinaysaa beddel waqti-badbaadin ah? Waxaa jira laba kaliya: code VBA ama qalabka dhinac saddexaad.

    >

Sida loo alifbeetada tabs ee Excel leh VBA

Hoos waxaad ka heli doontaa saddex tusaale code VBA si loo kala saaro Excel. Go'yaal kor u kaca, u soo degaya, iyo labada dhinacba iyadoo ku saleysan doorashada isticmaalaha.

Anagoo tilmaamaya inaad khibrad u leedahay VBA, waxaanu kaliya dul dhigi doonaa tillaabooyinka aasaasiga ah ee lagu daro makro xaashidaada shaqo:

>
  • Buuggaaga shaqada ee Excel, taabo Alt + F11 si aad u furto Tifaftiraha Aasaasiga ah ee Visual.
  • Shaqada bidix, midig-guji Buug-shaqeedkan , kadibna dhagsii Geli > Module .
  • Ku dhaji koodka VBA ee daaqada Code.
  • Riix F5 si aad u socodsiiso makro.
  • >Waayo Tilmaamaha tallaabo-tallaabo ee faahfaahsan, fadlan eeg Sida loo geli karo oo loo socodsiiyo koodhka VBA ee Excel.

    Talo. Haddii aad rabto inaad makro-ka sii isticmaasho, hubi inaad kaydiso faylkaaga sidii buug-shaqeedka macro-enabled Excel (.xlsm).

    Haddii kale, waxaad soo dejisan kartaa muunaddayada Alphabetize Excel Tabs-buugga shaqada, karti u yeel waxa ku jira haddii lagu dhaqaaqo, oo aad si toos ah uga socodsiiso makroda la rabo. Buuga shaqadu waxa uu ka kooban yahay macros kuwan soo socda:

    • TabsAscending - u kala sooc xaashida alifbeetada A ilaa Z u rog roga, laga bilaabo Z ilaa A.
    • AlphabetizeTabs - Kala sooc xaashida tabsiyada ee labada jiho, kor ama hoos u baxa. Excel, fur buug-shaqeedkaaga meesha aad rabto inaad xarfaha ku qorto tabs, taabo Alt + F8, dooro macro-ga aad rabto, oo guji Run .
    >

    U kala sooc tabaha Excel alifbeetada A ilaa Z

    Macro-kan yar waxa uu u habeeyaa xaashida buug-shaqeedka hadda jira sida xarfaha u kala horreeyaan , warqadaha shaqada ee ugu horreeya ee magacyadoodu ka bilaabmaan lambaro, dabadeed xaashiyaha A ilaa Z.

    Sub TabsAscending() For i = 1 Si aad u Codsatid.Sheetooyinka.Tirinta j = 1 Si aad u Codsato.Sheets.Tirinta - 1 Haddii UCase$(Codsiga. Xaashiyaha(j) Magaca) > UCase$(Application.Sheets(j + 1).Name Dhammaadka Sub

    Habee tabsyada Excel laga bilaabo Z ilaa A

    >Haddii aad rabto inaad u kala soocdo xaashidaada ka soo degaya nidaamka alfanumerickoodka soo socda:Sub Tabs Descending() Loogu talagalay i = 1 KuApplication.Sheets.Tirinta j = 1 Si loo Codsado UCase$(Application.Sheets(j + 1) .Name) Kadibna Codsiga " Dhammaadka Sub

    Alifbeetada tab ee kor u kacaya ama soo degaya

    >Macro-kani wuxuu u oggolaanayaa isticmaaleyaashaada inay go'aan ka gaaraan sida loo kala saaro xaashida shaqada ee buug-shaqeedka la siiyay, alifbeetada A ilaa Z ama siday u kala horreeyaan.> Tan iyo markii Sanduuqa wada-hadalka caadiga ah (MsgBox) ee Excel VBA wuxuu kaliya u oggolaanayaa inaad ka doorato gacan muggeed oo badhamada horay loo sii qeexay, waxaanu samayn doonaa foom noo gaar ah (UserForm) oo leh saddex badhamada: A ilaa Z, Z ilaa A, iyo Cancel.>Taas, fur Visual Basic Editor, midig-guji Buugga-Shaqada, oo dhagsii Geli> Foomamka Isticmaalaha. Magaca foomkaaga SortOrderFrom, oo ku dar 4 kontaroolo: calaamad iyo saddex badhammo:

    >

    > Marka xigta, taabo F7 (ama laba-guji foomka ) si aad u furto Codedaaqada oo aad ku dhejiso koodka hoose halkaas. koodka badhanka ayaa riixaya oo ku meeleeyaa sumad gaar ah badhan kasta:Click Sub CommandButton1_Click() Me.Tag = 1 Me.Qari Dhammaadka Sub CommandButton2_Click() Me.Tag = 2 Aniga () Me.Tag = 0 Me.Qari Dhamaadka Sub

    Waxay kuxirantahay in isticmaaluhu uu gujiyo A ilaa Z ama Z ilaa A ee foomkaaga, kala saar tabs gudahakor u kaca habka alifbeetada (lagu doortay si caadi ah) ama hoos u dhaca habka alifbeetada; ama xidh foomka oo waxba ha samayn haddii ay dhacdo Cancel . Tan waxaa lagu sameeyaa koodka VBA-da ee soo socda, kaas oo aad geliso habka caadiga ah adigoo isticmaalaya Geli > Module .

    Sub AlphabetizeTabs = 0 dabadeed ka bax Sub For x = 1 Si loo Codsado.Sheets.Tirinta y = 1 Si loo Codsado UCase$(Application.Sheets(y + 1).Name) Kadibna Xaashiyaha(y).Dhaqdhaqaaqa kadib:=Xaashi(y + 1) Dhammaysta haddi ElseIf SortOrder = 2 Kadibna Hadii UCase$(Application.Sheets(y).Name) < UCase$(Application.Sheets(y + 1) .Name Show (1) showUserForm = SortOrderForm si aad u kala soocdo tabs, oo aad AlphabetizeTabska wado buuggaaga shaqada:

    >

    > Dooro habka la doorbidayo, dheh, A ilaa Z, oo ilaali natiijooyinka:

    Talo. VBA-da, waxa kale oo aad samayn kartaa koobiyo waraaqahaaga shaqada ee Excel. Koodhka ayaa laga heli karaa halkan: Sida loonuqul ka mid ah xaashida Excel oo leh VBA.

    Sida loo xalliyo tabaha Excel alifbeetada iyada oo la adeegsanayo Ultimate Suite

    Isticmalayaasha our Ultimate Suite for Excel maaha inay ku dhex milmaan VBA - waxay leeyihiin tiro badan -Maareeyaha Buug-shaqeedka oo shaqaynaya:

    >>

    Iyadoo qalabkan lagu daray ribbonkaaga Excel, xarfaha xarfaha waxa lagu sameeyaa hal badhan oo gujis ah, sida ay tahay!

    >

    Haddii aad xiisaynayso inaad sahamiso tan iyo 70+ qalab xirfadeed oo dheeraad ah oo Excel ah, nooca tijaabada ah ee Ultimate Suite-kayaga ayaa diyaar u ah inaad soo dejiso halkan.

    >Waan ku mahadsan yahay adiga si aad wax u akhrido oo aad rajaynayso in aan kugu arko blog-keena todobaadka soo socda!>

    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.