Last active
April 16, 2017 15:39
-
-
Save ateneva/70e3a6308293fa1d34787da7797f8c2f to your computer and use it in GitHub Desktop.
Fill empty cell with value from another column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub FillInEmptyCellWithAdjacent() | |
Dim Cell As Range | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'written by Angelina Teneva, September 2016 | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'copy to column | |
For Each Cell In ActiveSheet.Range("AB2:AB" & ActiveSheet.UsedRange.Rows.Count) | |
Cell.Activate | |
On Error Resume Next | |
If ActiveCell.Value <> 0 And Cells(ActiveCell.row, 25) = 0 Then ActiveCell.Copy Cells(ActiveCell.row, 25) | |
If IsEmpty(ActiveCell) Or ActiveCell.text = "" And Cells(ActiveCell.row, 44).text <> "#N/A" Then ActiveCell.Value = Cells(ActiveCell.row, 44) | |
Next Cell | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment