+ Reply to Thread
Results 1 to 6 of 6

Change text value randomly based on category

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Bath, England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Change text value randomly based on category

    Hi,

    I am trying to create a tool that will allow me to see the effects on average hourly pay for groups when changing the gender ratios for those groups. I attach an example spreadsheet of what the tool would ideally look like:

    DATA - this tab has the raw data. Data is split by Grade, Discipline and Gender and organised into categories based on these three values.

    TOOL - this tab is where the user would insert the values for Grade, Discipline and Gender. Once they have completed this table they should be able to click the button below and it will select one row that matches the criteria at random and then change the gender value to the reverse, e.g. if they were to insert Standard, Structures, Male into the tool and hit the button the sheet would find one row on the DATA tab, at random, whose category is equal to StandardStructuresMale and change this category to StandardStructuresFemale

    Is this possible? I've spent many hours attempting this through formula / VBA, but my skills are not up to it.

    Any help greatly appreciated.

    cd254
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Change text value randomly based on category

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Change text value randomly based on category

    Is it just the gender you wish to change, and are you saying that the random one selected should be changed in the Data?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    04-11-2013
    Location
    Bath, England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Change text value randomly based on category

    Hi,

    Yes, just gender needs to change in the DATA tab.

    Thanks,

    Chris

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Change text value randomly based on category

    Hi,

    Here's one way in the Command buttn click event
    Please Login or Register  to view this content.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Change text value randomly based on category

    Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change color of chart based on category name
    By Frankximus3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2017, 06:09 AM
  2. Replies: 1
    Last Post: 12-17-2015, 03:35 AM
  3. Replies: 15
    Last Post: 10-12-2014, 08:53 AM
  4. Replies: 2
    Last Post: 07-15-2014, 08:24 PM
  5. Calculate a weighted average based on text category
    By zbomb2000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-27-2013, 10:07 PM
  6. [SOLVED] Code to randomly select from a list based on Cell text value inptted
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2013, 05:57 PM
  7. Sum numbers based on a category of a category
    By mattjac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2012, 11:08 PM

Tags for this Thread

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