Home VBA: Based on the numeric value in one column I want to input another value in a different column
Reply: 0

VBA: Based on the numeric value in one column I want to input another value in a different column

user894
1#
user894 Published in June 20, 2018, 7:26 am

I am new to VBA. I want to write code to look at numbers in column AD and return a value based on numeric value in column AG. Access Database statement is and the code I wrote that is returning an error is below. Really appreciate any help.

IIf([Days between File Date and CA Due Date]<30,"5",IIf(Eval([Days between File Date and CA Due Date] Between 31 And 60),"4",IIf(Eval([Days between File Date and CA Due Date] Between 61 And 90),"3",IIf(Eval([Days between File Date and CA Due Date] Between 91 And 150),"2",IIf([Days between File Date and CA Due Date]>151,"1","0")))))

Sub DayScore()
Dim LastRow As Long
    Dim i As Long
    LastRow = Range("AD" & Rows.Count).End(xlUp).Row
    For i = 2 To LastRow
        If Range("AD" & i).Value >= "30" Then
            Range("AG" & i).Value = "5"
        End If
    Next i
End Sub
Vba
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.383365 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO