Enter data from Different sheets to single sheet in same workbook once we enter data in single sheet

m_vishal_c

Board Regular
Joined
Dec 7, 2016
Messages
209
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
hi,
i have 1 workbook having 6 sheets
Mater invoice, Sheet2, Sheet3, Sheet4, Sheet5, Sheet6.
Sheet 2 to 6 have invoice no and invoice amount column. when i enter invoice no and amount in any Sheet then that Sheet name, invoice no and amount should be copied to Mater invoice file
and Mater Invoice sheet has Invoice and amount column too
Please let me know how can i fix by VBA
Thanks in Advance
 
The code is a WorkBook Event code, that means when you alter a cell in columns "A & B" of any sheet except "Master invoice" then the data you enter will automatically be sent to sheet "Master invoice" Columns "A,B & C".
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
The code is a WorkBook Event code, that means when you alter a cell in columns "A & B" of any sheet except "Master invoice" then the data you enter will automatically be sent to sheet "Master invoice" Columns "A,B & C".

HI Sorry to say that . this code does not work. Please guide me. thanks
 
Upvote 0
hi MickG. i download this file but when i enter in Sheet2, column A and B, those information does not comes up automatically in Mater Invoice sheet. do i need to press something
 
Upvote 0
HI MickG. thanks a lot. finally it works. i need data to be copied in "Master Invoice" sheet- B6(Sheet Name), E6(Invoice no), F6(Invoice amount) from other sheets(2,3,4). and invoice no and amount is start from G12, H12 in sheets(2,3 4). so what can be changed in this code. please guide me. if you want i can share file. please let me know. heaps heaps thanks
 
Upvote 0
This is new Example file with new Code:-
https://app.box.com/s/gkj1i5ly0wkjojh69kg0s5ksbr9g8l8f

This is the new Code:-
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Lst As Long, nLst As Long
Application.EnableEvents = False
If Not ActiveSheet.Name = "Master Invoice" Then
    
    If Not Intersect(Target, ActiveSheet.Range("G:H")) Is Nothing And Target.Row > 11 Then
With Sheets("Master Invoice")
    Lst = .Range("B" & Rows.Count).End(xlUp).Row
    nLst = IIf(Lst < 6, 5, Lst)
    
    If Application.CountA(Cells(Target.Row, "G").Resize(, 2)) = 2 Then
        .Range("B" & nLst + 1) = ActiveSheet.Name
        .Range("E" & nLst + 1).Value = Cells(Target.Row, "G").Value
        .Range("F" & nLst + 1).Value = Cells(Target.Row, "H").Value
    End If
End With
    End If
End If
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,377
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top