Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input box code
Hello
I have a spreadsheet with a blank column waiting to be populated by the user - let's call it 'category A'. At let's say every 5th cell going down the column I need an input box to pop up and ask the user if any of the value he is inputting is 'category B'. The value entered (even if it is a zero) should then be put in the cell immediately to the right of the original cell. Can anyone help please? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input box code
Take a look at using the WOrksheet_selectionchange macro.
Right click on the worksheet tab that you want to add the macro to and select view code. You should see a pulldown menu that reads GENERAL. Change it to Worksheet. Copy this code in Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Row Mod 5 < 0 Or Target.Column < 1 Then Exit Sub CatB = InputBox("Enter Category B value", CatB) Target.Offset(0, 1).Value = CatB End Sub This will give you an input box for every 5th row (5, 10, 15, etc) and column 1. If you want a different one, modify the IF statement. Good luck. "Les" wrote: Hello I have a spreadsheet with a blank column waiting to be populated by the user - let's call it 'category A'. At let's say every 5th cell going down the column I need an input box to pop up and ask the user if any of the value he is inputting is 'category B'. The value entered (even if it is a zero) should then be put in the cell immediately to the right of the original cell. Can anyone help please? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pause code, wait for input, no input received, carry on with the code | Excel Programming | |||
Input Box Question with Code | Excel Programming | |||
Input Box Code Please Help!! | Excel Programming | |||
Code for Input Box | Excel Programming | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |