View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joachim Fabini Joachim Fabini is offline
external usenet poster
 
Posts: 3
Default Automated cell copy depending on cell content?

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