Hi forum!
Trying to copy the active sheet to the workbook chosen by the user - but having trouble with how to define the new workbook.
Trying to copy the active sheet to the workbook chosen by the user - but having trouble with how to define the new workbook.
Code:
Sub ssss()
Dim myfile As Variant
Application.DisplayAlerts = False
Application.CopyObjectsWithCells = False
ActiveSheet.Copy
With ActiveSheet.UsedRange
.Value = .Value
End With
myfile = Application.GetOpenFilename
If myfile <> False Then
Workbooks.Open Filename:=myfile
'this part does not work -should copy the chosen file to the workbook chosen by the user
End If
Application.CopyObjectsWithCells = True
Application.DisplayAlerts = True
End Sub