+ Reply to Thread
Results 1 to 4 of 4

Replacing Text in Code from a List

  1. #1
    Registered User
    Join Date
    10-02-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    33

    Replacing Text in Code from a List

    Hi guys,

    I do not know if this is a simple task or not.
    I have the below code, where 'NORTH CLIENT' represents a 'department'. Now, I have like 150 different departments, and I'd rather not stay copying and pasting this code and changing the name 150 times. Is there a way this can be done quickly? I have the departments in an excel list, colom.

    Case "NORTH CLIENT"
    Sheets("NORTH CLIENT").Select
    NCLRow = ActiveSheet.Range("A6555").End(xlUp).Row + 1
    ActiveSheet.Range("A" & NCLRow).Select
    Selection.PasteSpecial
    Sheets("Main").Select

    Thanks
    Sam

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Replacing Text in Code from a List

    Hi

    Upload sample file.. I'll try to solve it for you..
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    10-02-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Replacing Text in Code from a List

    The group is in the sheet 'Client LIST'. (code is in the macro)
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Replacing Text in Code from a List

    Pl see the attached file.

    Insted of copy paste Array formulas are given in NORTH CLIENT(2) and SOUTH CLIENT(2) Sheets.Data is transfered from MAIN sheet to respective Sheets.I hope it will be useful.Same formula you can copy to all Sheets.

    In Each Sheet A1 cell Should have sheet name.
    Formula is written Assuming that MAIN sheet contains data uto 10000 Rows. Suitable changes can be done.
    Formulas can be dragged in both directions.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1