1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Select one from options in several rows

Discussion in 'Business Applications' started by kismaci, Jan 21, 2013.

Thread Status:
Not open for further replies.
  1. kismaci

    kismaci Thread Starter

    Joined:
    Jan 21, 2013
    Messages:
    1
    Hi!

    I've only getting know the macros, so it maybe a simple question.

    I've got several questions in rows, and the answers could be selected from 3 options (A, B, C)

    So it could be
    Questions | A | B | C |
    question1 | | | X |
    question2 | | X | |
    ...

    What I've managed to find (thanks to this forum ), how to add X with double clicks.
    (http://forums.techguy.org/business-applications/535860-does-excel-have-onclick-functionality.html, thanks for Zack Barresse)

    Code:
    Option Explicit
    
    Const MYRANGE As String = "D11:F11"
    
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Target.Cells.Count > 1 Then Exit Sub
        If Intersect(Target, Me.Range(MYRANGE)) Is Nothing Then Exit Sub
        Cancel = True
        If Target.Value = "" Then
            Target.Value = "X"
        Else
            Target.Value = ""
        End If
    End Sub
    
    How should/could I modify the code:
    - to only have one X in one row in the ABC range (if they want to overwrite it, the new cell's value should be "X", the other's "")
    - and do this in many rows? (not in the entire worksheet!)

    Thanks in advance!
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1086211

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice