Hi guys,
I have just written a code to convert some numbers from text format (They were imported from a PDF) to number format. The code seems to work perfectly when I step through it and watch what it is doing, however when I assign the macro to a button it causes all the converted numbers to go to zero. My code is below.
Many thanks in advance for your help!
I have just written a code to convert some numbers from text format (They were imported from a PDF) to number format. The code seems to work perfectly when I step through it and watch what it is doing, however when I assign the macro to a button it causes all the converted numbers to go to zero. My code is below.
Many thanks in advance for your help!
Code:
Sub Condition2()
For k = 8 To LastRow
Worksheets("Bordx Format").Cells(k, i - 1).Value = CDec(Cells(k, i - 1).Value)
Worksheets("Bordx Format").Cells(k, i - 1).NumberFormat = "0"
Next k
End Sub