KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 395
- Office Version
- 2016
- Platform
- Windows
Hi every one Are there any that can help combine these 2 VBA codes? So that the VBA code collects the 3 sheets with filename in G1 and I can put The file where I want from a dialog box (Application.Dialogs (xlDialogSaveAs) .Show ThisFile, 51) can save the file. All help will be appreciated. Regards Klaus W
VBA Code:
Sub Rektangelafrundedehjørner5_Klik()
Dim Fname As String, ws As Worksheet
Fname = Sheets("Stamdata").Range("g1").Value
Sheets(Array("1.deling", "2.deling", "3.deling")).Copy
For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
.Value = .Value
End With
Next ws
With ActiveWorkbook
.SaveAs Filename:=Fname
.Close
End With
End Sub
Sub Rektangelafrundedehjørner3_Klik()
ThisFile = Range("g1").Value
Application.Dialogs(xlDialogSaveAs).Show ThisFile, 51
End Sub