+ Reply to Thread
Results 1 to 9 of 9

Need help producing a inputbox on cell change within a range

  1. #1
    Registered User
    Join Date
    10-24-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Question Need help producing a inputbox on cell change within a range

    Hi all - apologies if this is anything similar that has come up before but ive been trolling these forums looking for an example to change that may work with what i want to no avail.

    Hence ive conceded that my VBA just isnt at the level my mind wants it to be - hence ive come to the experts.

    what i would like to achieve is this

    i have a range of data A12:N1000

    Data in each cell from column I is selected from a drop down list

    when a cell in column I is set to "Won", i would like the have an Inputbox pop up to enter a date, and that date is then placed in same row, column N as the cell selected as "won".

    any help is much appreciated.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Need help producing a inputbox on cell change within a range

    Try this:

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Need help producing a inputbox on cell change within a range

    Hi David and welcome to the forum.

    Put this code behind the sheet (not in a module) that you want it to work on..

    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    10-24-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Re: Need help producing a inputbox on cell change within a range

    thanks Alan,

    the script kind of worked, but it just ran and kept popping up on random spots on the spreadsheet.

    plus i don't want to have to 'run' it as such.

    id like it to be activated by change cell to "won" and only that same row has the date entered.

  5. #5
    Registered User
    Join Date
    10-24-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Re: Need help producing a inputbox on cell change within a range

    Marvin,

    yes this seems very close but didnt work. changing cell in col I didnt have any effect.

    Please see below file. this may be easier.

    basically its an estimation register, when we win a project, i want a prompt to enter the win date (otherwise it never gets filled out).


    Estimating Register 2014.xlsm

    thanks in advance

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Need help producing a inputbox on cell change within a range

    If you are looking for it to happen when you have a change event, then you should look at Marvin's solution. I interpreted your needs differently from your original description.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Need help producing a inputbox on cell change within a range

    Hi David,

    I tested on "Won" and you are looking for "WON". Try this new code.
    Attached Files Attached Files

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Need help producing a inputbox on cell change within a range

    if you add the term Option Compare Text before you write any code, then it will not be an issue as to the case of the criteria.

    http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx

  9. #9
    Registered User
    Join Date
    10-24-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    8

    Re: Need help producing a inputbox on cell change within a range

    Quote Originally Posted by MarvinP View Post

    I tested on "Won" and you are looking for "WON". Try this new code.
    Lol, rookie error. My bad sorry.

    that works perfectly, thankyou!

+ 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] Can't debug this code. The Arrays are producing a Subscript out of Range error
    By seigna in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-06-2013, 05:14 PM
  2. Replies: 6
    Last Post: 09-28-2012, 06:22 AM
  3. [SOLVED] InputBox - If input has &, change & to ^&
    By heather1209 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2012, 09:41 PM
  4. Producing a date range
    By jf674 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-08-2011, 12:55 PM
  5. Offset Inputbox function - change cell colour
    By TheLeafs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2011, 08:13 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