Saturday, 15 June 2013

excel - How to copy a weekly worksheet with a specific column of data onto a new worksheet -


Hope someone knows the answer ... I'm new to using VBA on excel.

Our Canteen staff is trying to create a weekly grocery budget. What I am trying to do, allows the user to create each weekly budget on a new worksheet.

What I have made so far is the table in which the "Stock Start" and "Stock End" columns.

I thought what happens to move the head of the kitchen to the "Stock Start" column for the "Stock Start" column when a new worksheet is created.

I thought that the best way to populate the worksheet with user data, and then clicking on a button will make it a new worksheet and the "stock end" column will be replaced with the newly created worksheet "Stock Start".

I also

I have been able to find two different pieces.

I wanted to set up a standard naming convention, such as "Week DD / MM / Y." Duplicate the first part "Master" worksheet and allow the user to name a new worksheet himself. It would be correct, but it depends only on the "master" worksheet. I want to duplicate this active worksheet.

The second part of the code that I have blocked with ' ' In the new sheet stock start (C4: C83), the data will be copied from Stock End (G4: G83).

But this Co-D must know the names of those worksheets in which the copy Is doing ...

Due to this I can not get to work as a 2 code one. I am lost ...

Here my Google Drive There is a copy of the spreadsheet in question:

Kind regards

T

  Private sub-command button (1_Click) dim Sena In the form of String Dim Wax as Worksheet worksheets ("Master"), copy: = Sheets (worksheets.quarter) set wks = ActiveSheet while sName << Wks.Name sName = Application.InputBox _ (Prompt: = "Enter new worksheet name") Error resume on next wks.Name = sName Go to error 0 loop set wks = 'nothing' worksheet (1) .Renz ("G4: G83") .PP 'Worksheets (2) .Range ("C4: C83") Paste Special XLPist Value and Sub  

< Using div class = "post-text" itemprop = "text">

workspace ("master") and worksheet (1) usage ActiveSheet Instead of Instead of using Worksheets (2) Usage wks .


No comments:

Post a Comment