Gå til hovedindhold

 Hvordan indsættes eksternt indhold i Excel, matcher altid destinationsformatering?

Når du kopierer og indsætter data fra andre eksterne applikationer til regnearket, indsætter Excel dataene med den originale formatering, de bruges som standard. Hvis du har brug for de indsatte data ved hjælp af det eget format på dit brugte regneark, skal du vælge Match destinationsformatering til dit behov, når du indsætter. Men hvis du har brug for at anvende denne mulighed ofte, kan jeg hjælpe dig med at indstille denne mulighed som standard, når du bruger Ctrl + V til at indsætte data.

Indsæt eksternt indhold til regneark matcher altid destinationsformatering med Excel-indstillinger

Indsæt eksternt indhold i regnearket matcher altid destinationsformatering med VBA-kode


Indsæt eksternt indhold til regneark matcher altid destinationsformatering med Excel-indstillinger

For at få Excel til at indsætte dataene med destinationsformatering, kan du tilføje en særlig kommando til din Hurtig adgangs værktøjslinje.

1. Klik File (Felt) > Indstillinger, og i Excel-indstillinger dialog boks:

  • (1.) Klik på Hurtig adgangs værktøjslinje i venstre rude;
  • (2.) Vælg derefter Alle kommandoer under Vælg kommandoer fra rulleliste
  • (3.) Og rul derefter ned og vælg Indsæt og match destinationsformatering i listeboksen
  • (4.) Klik derefter på Tilføj >> knappen for at tilføje denne kommando til Tilpas værktøjslinjen Hurtig adgang.

doc-match-destination-formatering-1

2. Når du har tilføjet denne kommando, skal du klikke på OK for at lukke denne dialogboks.

3. Og nu, den Indsæt og match destinationsformatering er blevet tilføjet til Tilpas værktøjslinjen Hurtig adgang, se skærmbillede:

doc-match-destination-formatering-2

Og når du indsætter data fra et andet program, skal du bare klikke på Indsæt og match destinationsformatering knappen i Hurtig adgangs værktøjslinje, indholdet indsættes på arket, der matcher destinationsformateringen af ​​dit regneark.

Bemærk: Denne metode anvendes ikke til Excel 2007.


Indsæt eksternt indhold i regnearket matcher altid destinationsformatering med VBA-kode

Du kan også indstille Match Destination Formatting som standardindstillingen for pasta, når du bruger Ctrl + V med følgende VBA-kode.

1. Hold nede ALT + F11 tasterne, og det åbner Vinduet Microsoft Visual Basic til applikationer.

2. Klik indsatte > Moduler, og indsæt følgende kode i Modul vindue.

VBA-kode: Indstil formatering af matchdestination som standardpasta

Sub PasteWithDestinationFormatting()
ActiveCell.PasteSpecial (xlPasteValues)
End Sub

3. Og gem og luk derefter denne dialog, og tryk derefter på Alt + F8 nøgler til at åbne Makro dialogen. I Makro dialog, skal du vælge det kodenavn, du oprettede i trin 2, og klikke på Indstillinger knappen, så i vises Makroindstillinger dialog, skal du åbne v under genvejstast sektion, se skærmbillede:

doc-match-destination-formatering-3

4. Klik derefter på OK i Makroindstillinger dialog, og luk Makro dialog boks.

Og nu, når du indsætter dine data fra ekstern applikation i regnearket med Ctrl + V, dataene indsættes som Match destinationsformatering som standard.


Relateret artikel:

Hvordan indstilles indsætningsværdier som standardpasta, når man bruger Ctrl + V i Excel?


Demo: Indsæt eksternt indhold i Excel matcher altid destinationsformatering

Kutools til Excel: med mere end 300 praktiske Excel-tilføjelsesprogrammer, gratis at prøve uden begrænsning på 30 dage. Download og gratis prøveversion nu!

Bedste kontorproduktivitetsværktøjer

🤖 Kutools AI Aide: Revolutionér dataanalyse baseret på: Intelligent udførelse   |  Generer kode  |  Opret brugerdefinerede formler  |  Analyser data og generer diagrammer  |  Aktiver Kutools funktioner...
Populære funktioner: Find, fremhæv eller identificer dubletter   |  Slet tomme rækker   |  Kombiner kolonner eller celler uden at miste data   |   Runde uden formel ...
Super opslag: VLookup med flere kriterier    Multiple Value VLookup  |   VOpslag på tværs af flere ark   |   Fuzzy Lookup ....
Avanceret rulleliste: Opret hurtigt rulleliste   |  Afhængig rulleliste   |  Multivælg rulleliste ....
Column Manager: Tilføj et bestemt antal kolonner  |  Flyt kolonner  |  Skift synlighedsstatus for skjulte kolonner  |  Sammenlign områder og kolonner ...
Fremhævede funktioner: Grid fokus   |  Designvisning   |   Stor Formel Bar    Arbejdsbog & Ark Manager   |  Ressourcebibliotek (Autotekst)   |  Datovælger   |  Kombiner regneark   |  Krypter/Dekrypter celler    Send e-mails efter liste   |  Superfilter   |   Specielt filter (filter fed/kursiv/gennemstreget...) ...
Top 15 værktøjssæt12 tekst Værktøjer (tilføje tekst, Fjern tegn, ...)   |   50 + Chart Typer (Gantt kort, ...)   |   40+ Praktisk formler (Beregn alder baseret på fødselsdag, ...)   |   19 Indsættelse Værktøjer (Indsæt QR-kode, Indsæt billede fra sti, ...)   |   12 Konvertering Værktøjer (Tal til ord, Valutaomregning, ...)   |   7 Flet og del Værktøjer (Avancerede kombinere rækker, Opdel celler, ...)   |   ... og mere

Overlad dine Excel-færdigheder med Kutools til Excel, og oplev effektivitet som aldrig før. Kutools til Excel tilbyder over 300 avancerede funktioner for at øge produktiviteten og spare tid.  Klik her for at få den funktion, du har mest brug for...

Beskrivelse


Fanen Office bringer en grænseflade til et kontor med Office, og gør dit arbejde meget lettere

  • Aktiver redigering og læsning af faner i Word, Excel, PowerPoint, Publisher, Access, Visio og Project.
  • Åbn og opret flere dokumenter i nye faner i det samme vindue snarere end i nye vinduer.
  • Øger din produktivitet med 50 % og reducerer hundredvis af museklik for dig hver dag!
Comments (14)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
On "Paste external content to worksheet always match destination formatting with VBA code". After "4. Then click OK in the Macro Options dialog, and close the Macro dialog box". The code would take effect only after saving/closing your worksheet.
This comment was minimized by the moderator on the site
Tried the close and save method. Still running into the same issue that Suneet was.
This comment was minimized by the moderator on the site
Hey, the macro for paste is not working. When I hit CTRL+v, it says: Run-time error '1004': PasteSpecial method of Range class failed
This comment was minimized by the moderator on the site
I'm getting this same error
This comment was minimized by the moderator on the site
Hello, guys,
If you want to paste the contents from website, you should apply the following VBA code.

Sub PasteWithDestinationFormatting()
Dim xRg As Range
Set xRg = Application.InputBox("Please select a cell to paste: ", "Kutools for Excel", , , , , , 8)
If xRg Is Nothing Then Exit Sub
xRg.Range("A1").Activate
ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, DisplayAsIcon:=False
End Sub

After pasting this code into the code module, and then go to the Macro dialog box to set the shortcut.
From now, when pasting contents from other applications, such as Word, website, a prompt box will pop out to remind you select a cell to put the pasting contents, and the contents will be pasted as Match Destination Formatting by default.

Hope it can help you! Thank you!
This comment was minimized by the moderator on the site
What a dick
This comment was minimized by the moderator on the site
That worked, but now I have to double click, or else the Kutools message comes up. Any solution?
This comment was minimized by the moderator on the site
Works for me, just in case somebody needs it.

Sub PasteWithDestinationFormatting()
ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, DisplayAsIcon:=False
End Sub
This comment was minimized by the moderator on the site
it works thanks
This comment was minimized by the moderator on the site
The problem I see after enabling this macro, that works nicely btw,is that my Undo button is greyed out and CTRL+z doesn't work anymore...
This comment was minimized by the moderator on the site
Same, I also cannot use CTRL+Z or and the Undo button is grayed out after using control +Z. But CTRL +V works now to allow me to copy and paste from Google Docs to Excel and have it match the destination format, saving me hundreds of clicks. Thanks!
This comment was minimized by the moderator on the site
i dont know how to thank you for this. its finally solved THANKYOU SOMUCH
This comment was minimized by the moderator on the site
OH MY GOODNESS !!!! YOU LITERALLY ARE A LIFE SAVER!
This comment was minimized by the moderator on the site
This worked for me. Thanks. You just saved me a few hundred clicks a day.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations