+ Reply to Thread
Results 1 to 3 of 3

cell cahnges based on a value in one cell

  1. #1
    Forum Contributor
    Join Date
    06-27-2014
    Location
    bristol, england
    MS-Off Ver
    excel 2007
    Posts
    264

    cell cahnges based on a value in one cell

    Hi all
    on a sheet cell b2 is for data entry, users will type in a number 1 to 5, if 1 is entered, cell d2 will show grade 1, if a 2 is entered in b2,d2 will show grade 1 and cell d3 will show grade 2 continuing down to cells d6 / grade 5
    what's the easiest way to do this using vba.

    also can a command button caption name be changed to what is showing in a cell ie, if d2 shows grade 1, the command button caption will be grade 1 (the command button will be on a different sheet).

    many thanks
    scouse13

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: cell cahnges based on a value in one cell

    Practice with this one, The code belongs in the worksheet module of sheet1

    RightClick.jpg
    Please Login or Register  to view this content.


    place a commandbutton on sheet2.

    In sheet1 change enter one of the numbers in B2 to activate the code.

    It might be best to use data validation dropdown in B2 so there is nothing entered incorrectly
    Attached Files Attached Files
    Last edited by davesexcel; 03-12-2017 at 12:53 PM.

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

    Re: cell cahnges based on a value in one cell

    Same as Dave's.
    Uses a Form-type command button on Sheet2

    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.

+ 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. Replies: 2
    Last Post: 12-07-2016, 12:39 PM
  2. Replies: 1
    Last Post: 12-06-2016, 06:16 PM
  3. return multiple header cell values into one cell concatenated based on a cell value
    By anchuri_chaitanya in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-13-2016, 10:27 PM
  4. Color Cell Based on Specific Text in Other Cell and Sorting Based on Results
    By kre30a in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2016, 07:51 PM
  5. [SOLVED] VBA to pick up a range of data that cahnges in size
    By MissDB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-13-2016, 09:18 AM
  6. Error when trying to protect/unprotect hide columns that update with cahnges
    By jeure in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2015, 12:47 PM
  7. Replies: 0
    Last Post: 03-20-2014, 10:57 AM

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