Hi
Apologies for the messy, cobbled together code but that's my novice level (for now)
For some reason the below is carrying out the first part of the code on worksheet "Aged stock" instead of worksheet "Finance" and I'm at a loss as to why.
Any suggestions gladly welcome.
Apologies for the messy, cobbled together code but that's my novice level (for now)
For some reason the below is carrying out the first part of the code on worksheet "Aged stock" instead of worksheet "Finance" and I'm at a loss as to why.
Any suggestions gladly welcome.
VBA Code:
With Worksheets("Finance")
Columns("N:Q").EntireColumn.Delete
LR = Cells(Rows.Count, 2).End(xlUp).Row
Range("N2:N" & LR) = Evaluate("M2:M" & LR & "/K2:K" & LR)
Range("N2:N" & LR).NumberFormat = "£0.00"
End With
With Worksheets("Aged Stock")
LR = Cells(Rows.Count, 2).End(xlUp).Row
Range("A2:A" & LR).Copy Range("H2:H" & LR)
Range("H2:H" & LR).TextToColumns Destination:=Range("H2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="@", FieldInfo:=Array(Array(1, 9), Array(2, 1)), TrailingMinusNumbers:=True
End With
With Worksheets("Aged Stock")
LR = .Cells(.Rows.Count, "H").End(xlUp).Row
With .Range("I2:I" & LR)
.FormulaR1C1 = "=VLOOKUP(RC8,'Finance'!C1:C14,14,FALSE)"
.Value = .Value
End With
End With
With Worksheets("Aged Stock")
LR = Cells(Rows.Count, "I").End(xlUp).Row
Range("J2:J" & LR) = Evaluate("F2:F" & LR & "*I2:I" & LR)
Range("J2:J" & LR).NumberFormat = "£0.00"
End With