Combine create new sheet and copy paste values only macros

oliviar

Board Regular
Joined
Sep 12, 2010
Messages
184
Hi Guys,
I have two macros I want to combine in order to create new clean, value only backups within my workbook.
I want to make a new sheet and name it with todays date. Then I want to go to ANY other sheet, copy all of it, and paste it to the new sheet with VALUES only.

I have two macros which do the two seperate parts. But my copy macro wants to pick a specific sheet only, whereas I want it to go to the new sheet.

Sub copy()
'
' copy Macro
'
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
'
Cells.Select
Range("T8").Activate
Selection.copy
Sheets("20 Oct 10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
<o:p> </o:p>
Sub NewSheet()
On Error GoTo Error
Dim AddSheet
Sheets.Add
AddSheet = Format(Date, "dd mmm yy")
ActiveSheet.Name = AddSheet
Exit Sub
Error:
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
MsgBox "A Sheet named " & AddSheet & " already exists."
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
For the first time ever, I am posting a solution to a problem! (It was my OWN problem, but I want it to count :LOL:).

This is the code that worked. It created a new sheet with today's date, and copies and pastes only the value from the sheet you were on, into the new sheet.

Sub Backup()

'
' Backup Macro
'
'
Cells.Select
Range("F19").Activate
Application.CutCopyMode = False
Selection.copy
Dim AddSheet
Sheets.Add
AddSheet = Format(Date, "dd mmm yy")
ActiveSheet.Name = AddSheet
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub

I hope someone else can use this one day.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top