আপনার প্রয়োজনীয়তাগুলি ভয়াবহভাবে পরিষ্কার নয়, যেমন অন্যান্য পোস্টারগুলি জানিয়েছে, তবে আমি ম্যাক্রোর সাথে একটি নমুনা ফাইল যুক্ত করেছি যা আমি মনে করি যে আপনার প্রয়োজনগুলি পূরণ করে।
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Dim PreviousRowStatus As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("H:H")
Application.EnableEvents = False
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Did a change occur to the status column (other than the column header?
If Range(Target.Address).Column = "8" And Range(Target.Address).Row <> 1 _
And Range(Target.Address).Row <> 2 Then ' Column H is column 8
' If the values are already the same, there's no need to make an update.
If Target.Offset(-1, 0).Value <> Target.Value Then
' Update the value of the previous row to match newly entered row
Target.Offset(-1, 0).Value = Target.Value
' Display a message when one of the designated cells has changed.
' MsgBox "Cell " & Target.Offset(-1, 0).Address & " has changed to " & _
Target.Value & " to match data in subsequent row."
End If
End If
End If
Application.EnableEvents = True
End Sub
শর্তসাপেক্ষ বিন্যাস ব্যবহার করে রঙগুলি স্বয়ংক্রিয়ভাবে সেট হয়। এটি কীভাবে কাজ করে সে সম্পর্কে আপনি যদি আরও জানতে চান তবে নীচের লিঙ্কগুলি দেখুন।