Muhammad Raza
New Member
- Joined
- Jun 11, 2014
- Messages
- 4
Dear All
I am new to VBA and am trying to modify a VBA code which is below. The following code perfectly copies the values form one worksheet into another. But I also want it to copy formats.
Any ideas?? - Many Thanks
Sub Practice_1()
Dim datasource As Worksheet
Set datasource = ThisWorkbook.Worksheets("ABC2")
Dim tunnel As Range
Set tunnel = datasource.UsedRange
Dim WB As Workbook
Set WB = Workbooks.Add()
WB.Sheets(1).Range(tunnel.Address).Value = tunnel.Value
End Sub
I am new to VBA and am trying to modify a VBA code which is below. The following code perfectly copies the values form one worksheet into another. But I also want it to copy formats.
Any ideas?? - Many Thanks
Sub Practice_1()
Dim datasource As Worksheet
Set datasource = ThisWorkbook.Worksheets("ABC2")
Dim tunnel As Range
Set tunnel = datasource.UsedRange
Dim WB As Workbook
Set WB = Workbooks.Add()
WB.Sheets(1).Range(tunnel.Address).Value = tunnel.Value
End Sub