export data between spreadsheets

S

scott

Hello,

how do I setup an excel file that each time when I enter data in one
spreadsheet it will export to another excel file in the same column of
subsequent rows?

Example: if each time data enter in one spreadsheet column A of row 1 it
will export this data to another spreadsheet column B of row 1,2,3... and so
on.

Thanks. Scott
 
G

Gord Dibben

What is your definition of "spreadsheet"?

Another workbook or another sheet within the same workbook?

I will assume worksheet in same workbook since you did mention "file"

In Sheet1 add this event code.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value <> "" Then
With Sheets("Sheet2").Cells(Rows.Count, "B").End(xlUp)
.Offset(1, 0).Value = Target.Value
End With
End If
stoppit:
Application.EnableEvents = True
End Sub

Right-click on Sheet1 tab and "View Code". Copy/paste the code into that
sheet module.

Note: Sheet2 B1 will remain blank or if you wish, add a title in B1 to
start with.


Gord Dibben MS Excel MVP
 

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