Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pause code, wait for input, no input received, carry on with the code [email protected] Excel Programming 1 September 29th 05 12:19 PM
Input Box Question with Code sebastienm Excel Programming 0 August 16th 04 07:37 PM
Input Box Code Please Help!! Struggling Hard!! Excel Programming 3 July 30th 04 12:29 AM
Code for Input Box Laura C Excel Programming 4 June 29th 04 05:27 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"