capture data from multiple sheets and add to the bottom of existin

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello out there
I am fairly new at this.
I need to be able to type data into 3 separate sheets and have that data
automatically add itself to the next available row of an existing database
list on another sheet (like a master register)
is this possible?
Nadia
 
This is assuming that the column no. will remain same.
The code should go in to ThisWorkBook's sheet_change procedure. I
assumed the master register sheet name to be "Sheet4", you can change it
to the actual master sheet name, in below code.


Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
Dim c As Range

If Sh.Name = "Sheet4" Then Exit Sub
With Worksheets("Sheet4")
Set c = .Cells(.UsedRange.Rows.Count, Target.Column)
If IsEmpty(c) Then
c.Value = Target.Value
Else
c.Offset(1, 0).Value = Target.Value
End If
End With
End Sub

Once value entered in to cells in any other sheets, the same will get
copied in to the next avaliable row, in the same column.
If after entering a value in to other cells, you clear it's contents,
then that change will not refect in the master sheet.

Sharad
 

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

Back
Top