PDA

View Full Version : Copy true number in another column



omidvakili2
03-26-2022, 01:10 PM
Hi guys

I need some help and I appreciate if help me https://www.excelforum.com/images/smilies/smile.gif

We need to check numbers (3720000000 - 3721000000) base on a formula if they are true or false.
I have a excel file, when I enter a number in B1, in B2 it show "True" or "false". If number be true, I copy the number in C1. If B2 show false I ignore and try another number. When another number be true, I copy it on C2, C3 , ...
Then we need a Vba to check B2, if it was true copy B1 in C column (next to last active cell).

Yours truly
omid

arnelgp
03-26-2022, 11:52 PM
a possible solution is using a Formula in Column C (copied down the column):

=IF(B1, A1, "")

omidvakili
03-27-2022, 08:52 AM
Sub copynum()
Dim i As Integer, result As String
For i = 0 To 10000
Cells(i, 15).Select
Selection.Copy
Range("C7").Select
ActiveCell.PasteSpecial
If Range("C8").Value = 1 Then
result = "TRUE"
Else
result = "FAIL"
End If
Cells(i, 16).Value = result
Next i
End Sub