does anyone know an easy way to copy a cell in column 1 to column 2
only when the cell in column 2 is blank orempty?
Thank you
Nestor
does anyone know an easy way to copy a cell in column 1 to column 2
only when the cell in column 2 is blank orempty?
Thank you
Nestor
Do alt+F11 and then Insert=>Module
in that module place code like:
sub copytoBlanks()
Dim icol as LOng, cell as Range, rng as Range
icol = 1
set rng = Range(cells(1,icol),cells(rows.count,icol).End(xlup))
for each cell in rng
if isempty(cell.offset(0,1)) then
cell.offset(0,1).Value = cell.value
end if
Next
end sub
Change icol to the column you want to process. As written it processes A
(source column) and B (copy to column) (icol = 1, column to right is B).
go back to Excel, then do Tools=>Macro=>Macros, select CopyToBlanks and
click run
--
Regards,
Tom Ogilvy
"Nestor" wrote:
> does anyone know an easy way to copy a cell in column 1 to column 2
> only when the cell in column 2 is blank orempty?
>
> Thank you
> Nestor
>
>
Thank you - this also worked:
=IF(ISBLANK(B3),A3,B3)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks