View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Automated cell copy depending on cell content?

=IF(AND(A2<"",A1="",A3=""),A2,A3)

Put this in all cells in column B

but put a blank row at the top. I guess you could be
clever and juggle about with the first row but best to
keep it simple.
-----Original Message-----
Hi,

Specifically, I'm looking for a macro that does the

following:

For a selected column
For any cell in this column
if (the current cell is not empty) and
(the cell above the current cell is empty) and
(the cell below the current cell is empty)
then
copy the content of the current cell into the

cell below
(alternatively, into the cell at the right).

The column A below should become column B after applying

the macro.

Col. A Col.B
<empty <empty
<empty <empty
one one
<empty one
<empty <empty
<empty <empty
two <two
three <three
<empty <empty
<empty <empty
four <four
<empty <four

This should be pretty straight-forward but I am totally

unaware of the
VB syntax. Thanks in advance,

Best regards
--Joachim




.