0

Starting off with this sample

First Photo

As Cell A1 is a list box/drop down with values off data from CELL F2:F6

[Second Photo2

As Cell A2:A6 is also a list box/drop down with values. Sample would be Pass and Fail.

Third Photo

As I change the values on CELLS A2:A6 based on selected value in the list box/drop down, G2:K2 reflects all the updated changes.

Fourth Photo

Fifth Photo

If cell A1's value is changed to update other rows, the same goes with the other row.

Sixth Photo

1
  • I've been trying to make my excel more organized and easier for editing and tracking since there are too many rows and columns for the array for manual editing and updating. Commented Apr 23, 2021 at 9:32

1 Answer 1

0

You can use VBA to paste your input in another cell.

First, define names on ranges as follows

  • TargetRow: CELL A1
  • TargetData: CELL A2:A6
  • Rows: CELL F2:F6

screenshot of defining names on ranges

Then, put the following VBA in under [your sheet] VBA editor

Option Explicit
Private Sub Worksheet_Change(ByVal rng As Range)
    If Not Intersect(rng, Range("TargetData")) Is Nothing Then
        Dim rowStr As String: rowStr = Range("TargetRow").Value2
        Dim l As Long: l = Range("Rows").Count
        Dim i As Long
        For i = 1 To l
            If Range("Rows").Cells(i, 1).Value2 = rowStr Then
                Dim n As Long: n = Range("TargetData").Count
                Dim j As Long
                For j = 1 To n
                    Range("Rows").Cells(1, 1).Offset(i - 1, j).Value2 = Range("TargetData").Cells(1, 1).Offset(j - 1, 0).Value2
                Next
            End If
        Next
    End If
End Sub

Worksheet_Change() is triggered if you make some changes on your sheet. Then check the change is done in TargetData range. Using "for" loop, find which row is to be updated.

Sign up to request clarification or add additional context in comments.

1 Comment

I shall check this out. I apologize for the late reply. It was the weekend and Im back to work now. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.