Calculation not work

zezo2021

Member
Local time
Today, 19:38
Joined
Mar 25, 2021
Messages
390
I want subtract to cell using VBA

but not work

Code:
Application.ScreenUpdating = False
Dim lr As Long
lr = Worksheets("Database").Range("C" & Rows.Count).End(xlUp).Row
Dim i As Integer
For i = 2 To lr
Worksheets("Database").Range("W" & i).Value = Worksheets("Database").Range("T", i).Value - Worksheets("Database").Range("B", i).Value
Next
Application.ScreenUpdating = True
 
Worksheets("Database").Range("W" & i)
Worksheets("Database").Range("T", i)
Worksheets("Database").Range("B", i)
Note how you reference the cells in on columns T and B.
 

Users who are viewing this thread

Back
Top Bottom