Note: The other languages of the website are Google-translated. Back to English
Logáil isteach  \/ 
x
or
x
Cláraigh  \/ 
x

or

Conas na roghanna go léir a phriontáil ar liosta anuas in Excel?

An ndearna tú iarracht riamh na roghanna go léir a phriontáil ar liosta anuas i mbileog oibre Excel? Tá an t-alt seo ag caint ar na roghanna go léir a phriontáil ar liosta anuas go asphrionta ar leithligh in Excel.

Priontáil gach rogha ar liosta anuas le cód VBA


Priontáil gach rogha ar liosta anuas le cód VBA


Is féidir leis an gcód VBA seo a leanas cabhrú leat gach rogha a phriontáil ar liosta anuas ar an mbileog oibre. Déan mar a leanas le do thoil.

1. Brúigh an Eile + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Sa Microsoft Visual Basic d’Fheidhmchláir fuinneog, cliceáil le do thoil Ionsáigh > Modúil. Ansin cóipeáil an cód VBA seo a leanas isteach i bhfuinneog an Mhodúil. Féach an pictiúr:

Cód VBA: Priontáil gach rogha i liosta anuas sonraithe i asphrionta ar leithligh

Sub Iterate_Through_data_Validation()
    Dim xRg As Range
    Dim xCell As Range
    Dim xRgVList As Range
    Set xRg = Worksheets("Sheet1").Range("B8")
    Set xRgVList = Evaluate(xRg.Validation.Formula1)
    For Each xCell In xRgVList
        xRg = xCell.Value
        ActiveSheet.PrintOut
    Next
End Sub

nótaí: Sa chód, is é Bileog 1 ainm na bileoige oibre ina bhfuil an liosta anuas a theastaíonn uait a phriontáil. Agus is é B8 an cill ina bhfuil an liosta anuas. Cuir na rudaí a theastaíonn uait ina n-áit.

3. Brúigh an F5 eochair chun an cód a rith.

Ansin déantar gach rogha ar an liosta anuas sonraithe i mbileog oibre áirithe a phriontáil amach ar leithligh.


Priontáil go héasca leathanaigh shonraithe sa bhileog oibre reatha in Excel:

Leis an Leathanaigh Sonracha a Phriontáil fóntais de Kutools le haghaidh Excel, is féidir leat leathanaigh shonraithe a phriontáil go héasca sa bhileog oibre reatha mar phriontáil go léir leathanaigh corr, Gach fiú leathanaigh, cló díreach an leathanach seo, chomh maith le raon leathanaigh saincheaptha a phriontáil mar atá thíos an pictiúr a thaispeántar.
Íoslódáil agus bain triail as anois! (Conair saor in aisce 30 lá)


Airteagail ghaolmhara:


Na hUirlisí Táirgiúlachta Oifige is Fearr

Réitíonn Kutools for Excel an chuid is mó de do chuid Fadhbanna, agus Méadaíonn sé do Tháirgiúlacht 80%

  • Athúsáid: Cuir isteach go tapa foirmlí casta, cairteacha agus aon rud a d'úsáid tú roimhe seo; Cealla a Chriptiú le pasfhocal; Cruthaigh Liosta Ríomhphoist agus seol ríomhphoist ...
  • Barra Foirmle Super (cuir línte iolracha téacs agus foirmle in eagar go héasca); Leagan Amach Léitheoireachta (líon mór cealla a léamh agus a chur in eagar go héasca); Greamaigh go dtí an Raon Scagtha...
  • Cumaisc Cealla / Sraitheanna / Colúin gan Sonraí a chailleadh; Ábhar Cealla Scoilt; Comhcheangail Sraitheanna / Colúin Dúblacha... Cill Dúblach a Chosc; Déan comparáid idir Ranganna...
  • Roghnaigh Dúblach nó Uathúil Sraitheanna; Roghnaigh Blank Rows (tá na cealla uile folamh); Aimsigh Super agus Fuzzy Aimsigh i go leor Leabhar Oibre; Roghnaigh go randamach ...
  • Cóip Díreach Cealla Il gan tagairt fhoirmle a athrú; Tagairtí Cruthaigh Auto chuig Bileoga Il; Cuir Urchair isteach, Boscaí Seiceála agus go leor eile ...
  • Sliocht Téacs, Cuir Téacs leis, Bain de réir Poist, Bain Spás; Subtotals Paging a chruthú agus a phriontáil; Tiontaigh Idir Ábhar Cealla agus Tráchtanna...
  • Scagaire Super (scéimeanna scagaire a shábháil agus a chur i bhfeidhm ar bhileoga eile); Ard-Sórtáil de réir míosa / seachtaine / lae, minicíocht agus níos mó; Scagaire Speisialta le cló trom, iodálach ...
  • Comhcheangail Leabhair Oibre agus Bileoga Oibre; Cumaisc Táblaí bunaithe ar eochaircholúin; Roinn Sonraí i Ilbhileoga; Baisc Tiontaigh xls, xlsx agus PDF...
  • Níos mó ná 300 gné chumhachtach. Tacaíochtaí Office / Excel 2007-2019 agus 365. Tacaíonn sé le gach teanga. Imscaradh éasca i d’fhiontar nó d’eagraíocht. Gnéithe iomlána triail saor in aisce 30 lá. Ráthaíocht ar ais airgid 60 lá.
cluaisín kte 201905

Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
bun officetab
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    mich · 2 months ago
    Thanks i used the first option it s amazing but i need to add to it that if there is a blank cell it should not print that option
  • To post as a guest, your comment is unpublished.
    Mich · 2 months ago
    Thanks i used the first option it s amazing but i need to add to it that if there is a blank cell it should not print that option
  • To post as a guest, your comment is unpublished.
    Zack · 1 years ago
    Hi is there a way to be able to preview first all the possible printouts in my drop-down list before it actually prints?
  • To post as a guest, your comment is unpublished.
    tj123 · 1 years ago
    How can i select a specific droplist, i want to print? , For example if i have 200 names on my droplist and i want to print a specific list, maybe 50 out of 200, How will i do this please?
  • To post as a guest, your comment is unpublished.
    Cloud · 2 years ago
    Thanks for the code. But I'm experiencing a minor issue when printing. When I tried to print the sheet with the drop down list. The first print out, prints the first item on the list while the next print out prints a blank data before it prints the second item from the list. What should I do?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi Cloud,
      What version of Excel are you using?
      The problem can't be reproduced in my case. Sorry for the inconvenience.
      • To post as a guest, your comment is unpublished.
        Cloud · 1 years ago
        Sorry I totally forgot about this. I'm using Excel 2013.

        So it wasn't actually a blank data.

        I have this dynamic drop down list in cell R17 which also populates other cells in the worksheet using VLOOKUP Function. What happens during print out is that the odd-positioned items on the list appears on the cell while the even-positioned items seemed not to show up that's why I thought it's printing blank pages.

        Thanks!
  • To post as a guest, your comment is unpublished.
    Juliette · 3 years ago
    Thank you for the post, this has helped me a lot. I was wondering if you had a way to do VBA to print Page 1 based on one drop-down selection and print Page 1 and 2 based on another drop-down selection? Thanks for any help you can provide.