Skip i'r prif gynnwys

Sut i arbed pob taflen waith fel gwerthoedd yn unig?

Os oes gennych lyfr gwaith sy'n cynnwys sawl fformiwla, nawr, mae angen i chi ddosbarthu'r ffeil hon i ddefnyddwyr eraill, nid ydych chi am ddangos y fformwlâu ond dim ond gwerthoedd sy'n cael eu harddangos. Fel rheol, gallwn arbed taflen waith yn gyflym fel gwerthoedd trwy gopïo a gludo'r data fel gwerthoedd yn unig. Ond, sut allech chi arbed pob taflen waith fel gwerthoedd yn unig heb gopïo a gludo fesul un?

Cadwch yr holl daflenni gwaith fel gwerthoedd yn unig gyda chod VBA


swigen dde glas saeth Cadwch yr holl daflenni gwaith fel gwerthoedd yn unig gyda chod VBA

Gall y cod VBA canlynol eich helpu i arbed pob dalen yn gyflym fel gwerthoedd (dim fformwlâu) a chadw'r holl fformatio celloedd. Gwnewch fel hyn:

1. Daliwch i lawr y ALT + F11 allweddi i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Cliciwch Mewnosod > Modiwlau, a gludwch y cod canlynol yn y Modiwlau Ffenestr.

Cod VBA: Cadwch yr holl daflenni gwaith fel gwerthoedd yn unig:

Sub Saveasvalue()
'Updateby Extendoffice
    Dim wsh As Worksheet
    For Each wsh In ThisWorkbook.Worksheets
        wsh.Cells.Copy
        wsh.Cells.PasteSpecial xlPasteValues
    Next
    Application.CutCopyMode = False
End Sub

3. Yna pwyswch F5 yn allweddol i redeg y cod hwn, ac mae'r llyfr gwaith cyfan wedi'i arbed fel gwerthoedd yn unig, mae'r holl fformiwlâu wedi'u tynnu ar unwaith dim ond gadael gwerthoedd gyda fformatio celloedd.

Nodyn: Cyn i chi gymhwyso'r cod, gallwch arbed copi o'r llyfr gwaith yn gyntaf.

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
Comments (18)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
thanks for help
This comment was minimized by the moderator on the site
sämst shjkjhgasghjdfsjhkfdgsdjhgafgb,ja u fdsvjkhgfkjahfg ka khdfzhjkg
This comment was minimized by the moderator on the site
Hi,
This is what i'm using (I exit the file automatically so I won't save accidently with values only).

But I wanted to keep just one sheet saved "normally" because I have a drop down list there that I would not like to lose when sharing the file.


Can anyone help me do this?

Thank you!


<div data-tag="code">Sub Saveasvalue()

Dim wsh As Worksheet
For Each wsh In ThisWorkbook.Worksheets
wsh.Cells.Copy
wsh.Cells.PasteSpecial xlPasteValues
Next
Application.CutCopyMode = False

savename = Application.GetSaveAsFilename(fileFilter:="Exel Files (*.xlsx), *.xlsx")
ActiveWorkbook.SaveAs Filename:=savename, FileFormat:=51

Application.DisplayAlerts = False 'exit without alerts
Application.Quit
End Sub
This comment was minimized by the moderator on the site
It runs good but i need a VBA of paste as value for a bunch of excels workbooks.



This comment was minimized by the moderator on the site
Is there any way to undo this if you've forgotten to save down the formula version first?
This comment was minimized by the moderator on the site
I need to publish Excel based financial statements with groupings. This worked to clear all the formulae and leave just the numbers. Other methods I tried cleared the groupings.
This comment was minimized by the moderator on the site
Good! Excellent! I need this but no any sheets
This comment was minimized by the moderator on the site
Remove all filters/protection in all the sheets. should work perfectly.
This comment was minimized by the moderator on the site
Tengo ese código, si bien es cierto funciona pero quisiera que no considere algunas hojas de mi archivo excel. se puede ?
Saludos.
This comment was minimized by the moderator on the site
Funcionou!! Muito Bom!!!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations