Check current cell is empty

B

bobocat

Hi,

I'm getting stuck...

If I enter some new data in Sheet2, column A, then this cell will be copied
to last cell of sheet 1 columnA automatically. This task can be done now

IF the data is overwriting some existing data, no need to copy.

my logic is
if the active cell is empty, and the target column is 1, then do the copy
and paste.
else, do nothing

The question is: how can I check the current cell is empty?

Thank you in Advance

Bobocat
 
J

Jim May

Sub tester()
If IsEmpty(ActiveCell) Then
MsgBox "Activecell Is Empty"
Else
MsgBox "Activecell Is Not Empty"
End If
End Sub
 
B

Bobocat

Sorry, It's not perfectly OK

In my test,

A1 empty
A2 empty
A3 Not empty

After I type something in A1, it return "Activecell is Empty", (it's ok)
But I type something in A2, it returns "activecell is not Empty"

I think that when I enter data in A2, when I press "Enter", the cursor will
move to A3, since the new Activecell is A3, so that is returns "not empty"

Can I check the cell before I enter the data?
 
J

Jim May

The Macro works on the Current activecell. That is, either before
or After you enter something in that cell. You're right
You probably have your Tools, Options set to have your
Cursor move to the next-downward cell once you enter something
In for example A4 - A4 is the target of your data, yet (afterwards)
A5 is active. So you would need to click again on cell A4 and run the
mcaro
It should tell you that A4 is not empty.
 
Top