Hi Excel Warriors
I have this VBA code that works fine, but i need to modify it to always copy to LAST ROW. As the criteria changes based on the selection, i am forced to copy all pages of the spreadsheet even if i only have a few entries.
Can anyone assist
Dim extension As String
extension = ".xlsx"
Application.DisplayAlerts = False
Application.CopyObjectsWithCells = False ' Does not copy Macro objects
ActiveSheet.Copy
With ActiveSheet.UsedRange
.Value = .Value
.Validation.Delete ' Removes all Drop Down Lists
End With
Set wbNew = ActiveWorkbook
wbNew.SaveAs ThisWorkbook.Path & "\" & Format(Date, "yyyy-mm-dd") & " " & ActiveSheet.Range("L2") & extension
wbNew.Close True
Application.DisplayAlerts = True
Application.CopyObjectsWithCells = True
I have this VBA code that works fine, but i need to modify it to always copy to LAST ROW. As the criteria changes based on the selection, i am forced to copy all pages of the spreadsheet even if i only have a few entries.
Can anyone assist
Dim extension As String
extension = ".xlsx"
Application.DisplayAlerts = False
Application.CopyObjectsWithCells = False ' Does not copy Macro objects
ActiveSheet.Copy
With ActiveSheet.UsedRange
.Value = .Value
.Validation.Delete ' Removes all Drop Down Lists
End With
Set wbNew = ActiveWorkbook
wbNew.SaveAs ThisWorkbook.Path & "\" & Format(Date, "yyyy-mm-dd") & " " & ActiveSheet.Range("L2") & extension
wbNew.Close True
Application.DisplayAlerts = True
Application.CopyObjectsWithCells = True