I have numbers in Col B followed by a full stop eg 1. 20. etc
I have tried to write code to copy the value in Col K that corresponds with 30. (same row) in Col B to Col K that corresponds with 25. in Col B same row
For eg the value in col K for 30. is K40 and the value is 108,965 and this must be copied as a value using paste special values in Col k in the same row as 25.
I get paste special class failed when running my macro
See my code below
it would be appreciated if someone could amend my code
I have tried to write code to copy the value in Col K that corresponds with 30. (same row) in Col B to Col K that corresponds with 25. in Col B same row
For eg the value in col K for 30. is K40 and the value is 108,965 and this must be copied as a value using paste special values in Col k in the same row as 25.
I get paste special class failed when running my macro
See my code below
it would be appreciated if someone could amend my code
Code:
Sub Compute_Opening_inventory()
Dim lRow As Long, I As Long
lRow = Cells(Rows.Count, 11).End(xlUp).Row
For I = 1 To lRow
If Left(Cells(I, 1), 3) = "30." Then
Cells(I, 11).Copy
End If
If Left(Cells(I, 1), 3) = "25." Then
Cells(I, 11).PasteSpecial xlValues
Application.CutCopyMode = False
End If
Next
End Sub