![]() |
Please help! Copy sheet to another sheet from cell value
Hi I could really do with some one help with this if possible??? The problem which I have is I have 52 sheets for the year and a master sheet for data to be edited. I want the to enter a week number E.g. (Wk2) into a cell, and the macro would look up that worksheet which already exsists and copy the worksheet tot hat sheet. E.g. If I enter Wk2 into cell (Q7) on the master sheet, I would want the sheet to copied to Wk2. Hope some one can help -- bsnapool ------------------------------------------------------------------------ bsnapool's Profile: http://www.excelforum.com/member.php...o&userid=36115 View this thread: http://www.excelforum.com/showthread...hreadid=558866 |
Please help! Copy sheet to another sheet from cell value
with Master the active sheet, right click on the sheet tab and select view
code. In the resulting module paste in code similar to this: Private Sub Worksheet_Change(ByVal Target As Range) Dim sh As Worksheet If Target.Address(0, 0) = "Q7" Then On Error Resume Next Set sh = Worksheets(Target.Value) On Error GoTo 0 If Not sh Is Nothing Then Cells.Copy sh.Cells Else MsgBox Target.Value & " does not exist" End If End If End Sub -- Regards, Tom Ogilvy "bsnapool" wrote: Hi I could really do with some one help with this if possible??? The problem which I have is I have 52 sheets for the year and a master sheet for data to be edited. I want the to enter a week number E.g. (Wk2) into a cell, and the macro would look up that worksheet which already exsists and copy the worksheet tot hat sheet. E.g. If I enter Wk2 into cell (Q7) on the master sheet, I would want the sheet to copied to Wk2. Hope some one can help -- bsnapool ------------------------------------------------------------------------ bsnapool's Profile: http://www.excelforum.com/member.php...o&userid=36115 View this thread: http://www.excelforum.com/showthread...hreadid=558866 |
Please help! Copy sheet to another sheet from cell value
You are a legend!! Nice one -- bsnapool ------------------------------------------------------------------------ bsnapool's Profile: http://www.excelforum.com/member.php...o&userid=36115 View this thread: http://www.excelforum.com/showthread...hreadid=558866 |
All times are GMT +1. The time now is 10:31 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com