Consulting

Results 1 to 3 of 3

Thread: Duplicate the sheet and updte the Master

  1. #1
    VBAX Newbie
    Joined
    Sep 2019
    Posts
    4
    Location

    Duplicate the sheet and updte the Master

    Dear Friends,

    Please help me in achieving this task

    1. I have Country Master
    2. I have Product Master
    3. When ever New Country is added existing any one of the Country sheet should be duplicated and rename to the new country name
    4. Then Product Master should be updated in New Country sheet
    5. The same way when New Product is added that should updated in all the country sheet below the existing last item

    Thanks,
    Sundarvelan
    Attached Files Attached Files

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Worksheets are Excel Objects. Objects can have custom Properties. Add to the top of each Country sheet's codepage:
    Option Explicit
    
    Property Get SheetType() As String
       SheetType = "Country" 
    End Property
    Any sheet can have any SheetType. Ie. "Products," "Prices," "etc." The Property code structure remains the same for all sheet types. Only the String changes.

    Create a Country sheet Template, including any existing products in its List. include SheetType "Country" on its codepage.
    Use a macro with an InputBox to get the new Country Name and copy the Country sheet Template.

    Use a Macro to add the new Product info to all "Country" Sheets.
    Dim Sht As Worksheet
    
    For Each Sht in Sheets
       If Sht.SheetType = "Country" Then
          'Add your code to copy Product info to Sht here
       End If 
    next
    Good luck.

    Au revoir.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    Sep 2019
    Posts
    4
    Location
    Dear Friend,

    Since I'm new to vba, notable to understand.

    Please help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •