Go to next cell if full

A

albertmb

Hi Everyone,

On the 15-01-2010 Micky was so kind to send me this macro which I found most
valuble. I tried to reach him again through the Q&A we started but it seems
we lost contact. Can anyone please help me adjust this macro to my specific
needs.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
LR = Sheets("Sheet2").Cells(Rows.Count, 4).End(xlUp).Row
If IsEmpty(Sheets("Sheet2").Cells(1, 4)) Then
Target.Cut Sheets("Sheet2").Cells(LR, 4)
Else
Target.Cut Sheets("Sheet2").Cells(LR, 4).Offset(1)
End If
Application.EnableEvents = True
End If
End Sub
============
Micky

Can this macro be applied to a range of cells as
the 'Target Adress?

What I would like is that the data will be transfered to 'Sheet2' after the
complition of the last cell in the range of the 'Target Address'

Ex: Sheet1 Range A1:A4 will be transfered to Sheet2 Range A1:A4 and this
will be done after data is entered in Sheet1 Cell A4 so that all 4 cells are
full and after transfer of data, data in Shee1 Range A1:A4 will be cleared.

Your kind help will be greatly appreciated

Thank You

Best Regards
Albert
 
×

מיכ×ל (מיקי) ×בידן

Hi, Albert,
I'm sorry but I do not browse any of the previous DC pages especially
because MS is too lazy to "repair" the Mail-Alert engine which intends to
send an E-Mail for each response in a thread one participated in.
Please try the following code.
=======================================
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$1" Then
Application.EnableEvents = False
LR = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
With Sheets("Sheet1").Range("A1:D1")
If IsEmpty(Sheets("Sheet2").Cells(1, 1)) Then
.Cut Sheets("Sheet2").Cells(LR, 1)
Else
.Cut Sheets("Sheet2").Cells(LR + 1, 1)
End If
End With
Application.EnableEvents = True
End If
End Sub
==========
Micky
 
A

albertmb

Hi again Micky, Thank you ever so much I did realise that because I did not
recive the emails either. But once again It worked to perfection

Thank you
Albert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top