English 中文(简体)
当同一范围的任何囚室的价值发生变化时,如何改变囚室在数据验证范围内的价值
原标题:How to change the value of cells in a range with data validation when the value of any of the cells in that same range changes

我正在制作一份“Excel”清单,用于在一次RPG游戏中进行敌人接触(展示)。

该清单是两个栏目表,每组A组使用一个数据验证清单,其数值为✔、✘和R. Column B,包含所有按时间顺序排列的敌编,包括不同游戏时出现的反复编组。 每个编组都有相应的Lumn A组。

All values in Column A are preset to ✘. When the player encounters a formation, they can select ✔. The value in Column A is used by a formula in another cell that becomes GREEN when all the possible formations have been marked as ✔ or R.

然而,如上所述,清单中含有反复出现的成分,因此,如果参与者(以✔为标志)在游戏中会晚会同一种成分,然后能将其标记为✔。

What I want (and haven t been able to do) is either one of the following different solutions: (I m using an example formation for clarity)

十三、选举

  • When the player marks any of the Goblin x 2 formations as ✔, all other values in Column A corresponding to Goblin x 2 formations that are not the one marked as ✔ become R.

宗旨

  • When the player marks any of the Goblin x 2 formations as ✔, all other values corresponding to Goblin x 2 formations become ✔.

变迁

  • Any idea is very much pretty welcomed.

附带条件格式。 Wrong alley.

创立这一公式=IF(OR(ISNUMBER(SEARCH({“Formation”},A1)),“✔”,但又未能使它做我所需要的工作。 我还遇到了数据验证限制的问题。

现在,对点数进行实验。 或许我应该使用VBA? 我不知道这一点,但是如果我知道开始处理这一具体问题,我愿意研究。

查谟和克什米尔民主运动确实是有用的。 它建议使用简单的=A1, =A2等。 不是大事。 (当然没有及时使用正确)。

感谢!

问题回答

你们必须为此利用传统做法:

Option Explicit

Private Sub Worksheet_Change(ByVal target As Range)
    Dim ColA As Range: Set ColA = Me.Range(Me.Range("A1"), Me.Cells(Me.Rows.Count, "A").End(xlUp))
    Dim ColB As Range: Set ColB = ColA.Offset(0, 1)
    Dim TargetFiltered As Range: Set TargetFiltered = Application.Intersect(ColA, target)
    If Not TargetFiltered Is Nothing Then
        Dim TargetCell As Range: For Each TargetCell In TargetFiltered.Cells
            If TargetCell.Value = "T" Then
                Dim Formation As Variant: Formation = TargetCell.Offset(0, 1).Value
                Dim r As Long: For r = 1 To ColA.Rows.Count
                    If ColA.Row + r - 1 <> TargetCell.Row Then
                        If ColA.Cells(r, 2).Value = Formation Then
                            If ColA.Cells(r, 1).Value = "F" Then
                                ColA.Cells(r, 1).Value = "R"
                            End If
                        End If
                    End If
                Next
            End If
        Next
    End If
End Sub

我用“T”和“F”代替支票,因为我不知道你如何执行。





相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签