jasleentatlay
New Member
- Joined
- Mar 8, 2019
- Messages
- 2
I am trying to use following VBA code to copy and pastevalues only.I want to modify it where code can automatically find last cellused (this case I mentioned A1:D29 I would want system to find on its own.
Please advise.
Sub TransferValuesOnly()
Dim rng As Range
Set rng = Workbooks("Book1.xlsx").Worksheets(4).Range("A1:D29")
Workbooks("Mastertemplate.xlsx").Worksheets(3).Range("A7").Resize(rng.Rows.Count,rng.Columns.Count).Cells.Value = rng.Cells.Value
End Sub
Please advise.
Sub TransferValuesOnly()
Dim rng As Range
Set rng = Workbooks("Book1.xlsx").Worksheets(4).Range("A1:D29")
Workbooks("Mastertemplate.xlsx").Worksheets(3).Range("A7").Resize(rng.Rows.Count,rng.Columns.Count).Cells.Value = rng.Cells.Value
End Sub