hi, I'm new to Excel VBA. I am trying to write code that will select and check multiple cells. if cells contain a specific integer, then an assigned calculation would be done for the adjacent cells.
I've pasted below my latest attempt to archive the above-mentioned objective
Sub Rebar_total_length ()
Dim total As Integer
Dim A As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
total = Range("A5:a80")
If total = 38 Then
Range("g5:g80") = A + b + c
End If
End Sub
I've pasted below my latest attempt to archive the above-mentioned objective
Sub Rebar_total_length ()
Dim total As Integer
Dim A As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
total = Range("A5:a80")
If total = 38 Then
Range("g5:g80") = A + b + c
End If
End Sub