Thema Datum  Von Nutzer Rating
Antwort
Rot Only copy values to new workbook
05.08.2019 16:08:49 Sabrina
NotSolved
05.08.2019 22:51:34 Flotter Feger
Solved
06.08.2019 08:14:06 Gast73066
NotSolved
06.08.2019 17:46:15 Flotter Feger
NotSolved

Ansicht des Beitrags:
Von:
Sabrina
Datum:
05.08.2019 16:08:49
Views:
694
Rating: Antwort:
  Ja
Thema:
Only copy values to new workbook

Hi All,

I have the following code:

Sub Splitbook()        
Dim xPath As String   
Dim rng As Range
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set rng = ActiveWorkbook.Sheets("Overview").Range("Approver")     
For Each xws In ActiveWorkbook.Worksheets                          
If Not IsError(Application.Match(xws.Name, rng, 0)) Then          
    xws.Copy                                                     
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & "Travelcosts" & " " & "Team" & " " & xws.Name & " " & xws.Range("F1") & ".xlsx"
    Application.ActiveWorkbook.Close False
End If
Next xws
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

 

Now the new workbooks get saved at the right place, but they still have the formulas inside. So when I change something in the original workbook the new workbooks change as well. But that's not what I want. I only want to copy the values and the format - not the formulas. Does anybody have an idea for me?

Thanks in advance.

Best regards,

Sabrina


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Only copy values to new workbook
05.08.2019 16:08:49 Sabrina
NotSolved
05.08.2019 22:51:34 Flotter Feger
Solved
06.08.2019 08:14:06 Gast73066
NotSolved
06.08.2019 17:46:15 Flotter Feger
NotSolved