Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, i currently have the following vlookup code which works find, however i need to hopefully change it dependant on the Quarter of the calendar year we are in.
With ActiveSheet
LR = .Cells(.Rows.Count, 25).End(xlUp).Row - 1
With .Cells(2, 12).Resize(LR)
.Formula = "=VLOOKUP(a2,'check summary'!$A$1:$s$" & x & ",19,0)"
.Value = .Value
.Replace "#N/A", ""
End With
End With
for example in in Quarters 1 and 3 this vlookup is correct, however in quarters 2 and 4 it would need to look at column 20 not 19.
Is it possible to code this in? or do i need to come up with another solution.
With ActiveSheet
LR = .Cells(.Rows.Count, 25).End(xlUp).Row - 1
With .Cells(2, 12).Resize(LR)
.Formula = "=VLOOKUP(a2,'check summary'!$A$1:$s$" & x & ",19,0)"
.Value = .Value
.Replace "#N/A", ""
End With
End With
for example in in Quarters 1 and 3 this vlookup is correct, however in quarters 2 and 4 it would need to look at column 20 not 19.
Is it possible to code this in? or do i need to come up with another solution.