Results 1 to 4 of 4

Thread: Macro to Copy Values and fill colors.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    I tossed this together
    Private Sub btnCreateNewSheet_Click()
        
        Dim templateRange As Range
        Dim newSheet As Worksheet
        Dim newSheetName As String
        
        ' define what range to copy from
        Set templateRange = Worksheets("Template").Range("A1:D10")
        
        ' create a new sheet and name it today's date
        newSheetName = Format(Date, "MM-DD-YYYY")
        Set newSheet = ThisWorkbook.Sheets.Add
        newSheet.Name = newSheetName
        
        ' copy the template range to the new sheet
        templateRange.Copy
        newSheet.Range("A1:D10").PasteSpecial xlPasteValues
        newSheet.Range("A1:D10").PasteSpecial xlPasteFormats
        
    End Sub
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •