+ Reply to Thread
Results 1 to 5 of 5

Make Static code Dynamic

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2018
    Posts
    1,106

    Make Static code Dynamic

    In Column G of sheet7 I have a list of initials (two characters each).
    In Column H sheet7 I have a list of names that correspond to Column G.

    In my code below I hard coded the "initials" (G) and "names" (H)
    Im trying to make the code dynamic where column G and H could have added or removed without editing the code.
    Simply not sure how to go about this?

    Please Login or Register  to view this content.
    Any hints, tips or examples is appreciated.
    Regards

    Rick
    Win10, Office 365

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

    Re: Make Static code Dynamic

    Hi

    Upload the sample data file with the required output...
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2018
    Posts
    1,106

    Re: Make Static code Dynamic

    See attached file.
    Sheet1 (Main Page) contains the macros in my initial post.
    Attached Files Attached Files

  4. #4
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2018
    Posts
    1,106

    Re: Make Static code Dynamic

    I have attempted this code:
    Please Login or Register  to view this content.
    But I get an error:
    Run-time error '424':
    Object required
    at "sLogin2 = sht7CellG.Offset(0, 1)"
    The data for "sht7CellG.Offset(0, 1)" is correct!?

  5. #5
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2018
    Posts
    1,106

    Re: Make Static code Dynamic

    This has become a problem of passing an Objects value to a string.
    I started a new post to cover this.
    http://www.excelforum.com/excel-prog...90#post2812890

+ 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