anguschanch
New Member
- Joined
- Jun 16, 2014
- Messages
- 45
Hi i wrote this code but it doesnt work as i expected. Can someone please help me solving it?
There are 366 sheets in my workbook, namely "Sheet1", "1", "2",...,"365".
In "Sheet1":[TABLE="width: 300"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Day:[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What i want to do this copy all cell in sheet1 and paste it to the worksheet specified in cell B1, and i want to paste value only.
There are 366 sheets in my workbook, namely "Sheet1", "1", "2",...,"365".
In "Sheet1":[TABLE="width: 300"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Day:[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What i want to do this copy all cell in sheet1 and paste it to the worksheet specified in cell B1, and i want to paste value only.
Code:
Sub copy()
Worksheets("Sheet1").Activate
Columns("A:M").Select
Selection.copy
Worksheets(Worksheets("Sheet1").Range("B1").Value).Activate
ActiveSheet.Paste
End Sub