Sum of Offset Values

Lauren123

New Member
Joined
Mar 16, 2018
Messages
28
Hi, I have this formula, but i would like to just have in "K" the sum of offset(0,3)+offset(0,4) is it possible on VBA or should i add up that on the sheet and just copy it?


Rw = 11
With Sheets("Draft")
For Each Cl In .Range("K7", .Range("K" & Rows.Count).End(xlUp))
If Cl.Value = "YES" Then
Sheets("U-Detail").Range("K" & Rw).Value = Cl.Offset(0, 3)
Rw = Rw + 1
End If
Next Cl
End With
' Tax
Rw = 11
With Sheets("Draft")
For Each Cl In .Range("K7", .Range("K" & Rows.Count).End(xlUp))
If Cl.Value = "YES" Then
Sheets("U-Detail").Range("L" & Rw).Value = Cl.Offset(0, 4)
Rw = Rw + 1
End If
Next Cl
End With
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,832
Office Version
  1. 2013
Platform
  1. Windows
Try this:
Code:
Sub Add_Me()
'Modified 5/24/18 9:20 PM EDT
Application.ScreenUpdating = False
Dim Cl As Range
Dim RW As Long
RW = 11
With Sheets("Draft")
    
    For Each Cl In .Range("K7", .Range("K" & Rows.Count).End(xlUp))
        If Cl.Value = "YES" Then
            Sheets("U-Detail").Range("K" & RW).Value = Cl.Offset(0, 3) + Cl.Offset(0, 4).Value
            RW = RW + 1
        End If
    Next
End With
Application.ScreenUpdating = True
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,109,127
Messages
5,526,989
Members
409,733
Latest member
revender17

This Week's Hot Topics

Top