Send contents to another page
I didn't say they were the same! You did.
Send could indicate "move" what what I was getting at.
This will copy............ =Sheet1!A1 entered in a cell in Sheet2
This will copy using VBA.........................
ActiveSheet.Range("A5").Resize(1, 10).Value = _
Worksheets("Sheet1").Range("A1:J1").Value
This will cut and move using VBA..............................
myRange.Cut Destination:=ActiveSheet.Range("C1")
For your purposes I am assuming you will use only A1 and B1 to enter data.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rng1 As Range
Set rng1 = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp) _
..Offset(1, 0)
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$B$1" And Target.Value < "" _
And Target.Offset(0, -1).Value < "" Then
Me.Range("$A$1:$B$1").Cut Destination:=rng1
End If
stoppit:
Application.EnableEvents = True
End Sub
This is sheet event code. Right-click on sheet1 tab and "View Code".
Copy/paste the code into that module.
Alt + q to return to Excel window.
Enter something in A1 then enter something in B1.
Both cells will be CUT and moved to first available row on Sheet2.
Gord
On Sat, 8 Mar 2008 14:34:00 -0800, Richard
wrote:
Explain, whats the difference from copy to on sheet rather than send to one
sheet, if both does the same then either one? Send or copy?
"Gord Dibben" wrote:
"Send or copy, either one, they are both the same"
To quote from another post...."that is bullcrap".
You don't have to copy to send something.
Also from your original post..............
"I quess in the worksheet change event?"
Now you state
And what do you mean by the event code. If I knew what is was and how to use it I wouldn't meed
any help with it.
I won't be answering any more of your questions per your request.
Lotsa luck.
I'm sure you'll get good advice once someone knows the answer to
"each time something is added to sheet1"..........where?
In row 1 again? Or row 2 then row 3 then row 4?
Gord
On Sat, 8 Mar 2008 13:53:02 -0800, Richard
wrote:
Send or copy, either one, they are both the same. And yes it has to be
copied before it can be moved, else what are you moving? And what do you mean
by the event code. If I knew what is was and how to use it I wouldn't meed
any help with it. And as to where the data is being sent is on my post, sent
to sheet2 to the next available row!
"Gord Dibben" wrote:
"Send" means what?
Copy or Move?
The event code could do either.
To where would the data be "sent"?
To next empty row in sheet2 or overwrite the same row in sheet2 when data is
entered in a corresponding row on sheet1?
Gord Dibben MS Excel MVP
On Sat, 8 Mar 2008 09:28:00 -0800, Richard
wrote:
I'm trying to send the contents to another sheet without having to copy/paste
each time. Whenever something is entered into sheet 1 that row is sent to
sheet 2. I quess in the worksheet change event? Thanks in advance!!
|