excel vba copy paste data from another workbook code example
Example 1: excel vba copy entire sheet paste values
Sub CopySheetPasteAsValues()
Sheets("Sheet1").Cells.Copy
Sheets("Sheet1").Cells.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub
Example 2: excel vba paste all to each sheet in workbook
Option Explicit
Sub Button4_Click()
Const RangeAddress As String = "H4:AD600"
Dim SourceRange As Range
Dim i As Long
With ThisWorkbook
Set SourceRange = .Worksheets(1).Range(RangeAddress)
SourceRange.Copy
For i = 2 To .Worksheets.Count
.Worksheets(i).Range(RangeAddress).PasteSpecial xlPasteFormulas
Next i
For i = .Worksheets.Count To 1 Step -1
.Worksheets(i).Activate
.Worksheets(i).Range("A1").Select
Next i
End With
Application.CutCopyMode = False
MsgBox "Copied Range(" & RangeAddress & ") from the first to " _
& "the remaining worksheets.", vbInformation, "Copy Range"
End Sub