• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Transfer to another sheet data

Mukhtar

New Member
Dear Forum Member,

I have a spreadsheet having 2 Invoice Templates containing data, one is of Retail Bill (Sheet 1) and another of Wholesale Bill (Sheet 2). I have a submit button on both sheets with same type of VBA code, one in Module1 for Retail bill and second in Module 2 for wholesale Bill. They both work finely. The problem is When I press the submit button, the data from the Retail Bill gets copied and pasted on a table range from Cell ("AA3") onwords upto ("AQ3") on the same sheet. This table is common in all 3 sheets. Sheet1 renamed "Retail Bill", Sheet 2 renamed "Wholesale Bill", and Sheet3 renamed as "Entries".
I want the data of Retail bill to be tranfer d to Sheet 3 ("Entries") Table already created.
I want the data of Wholesale bill to be tranfer d to Sheet 3 ("Entries") Table already created.

I mean whenever the submit button of both Invoices Retail or Wholesale is pressed the Data should go to the same sheet 3("Entries).
I tried changing the sheet nos, but was unsuccessful. I am not so good at Excel VBA.

If the entries of both bill go to same sheet 3, it will help me create a single inventory instead of 2.

File is attached (Invoice Sample- Binary Excel file still works with VBA coding. Excel 2007.

I need that code which can transfer data to sheet 3 ("Entries")

Thank in advance,

Regards,
Mukhtar
 

Attachments

  • Invoice_Sample.xlsb
    48.5 KB · Views: 9
Dear Forum Members,
Will somebody help me with answer.
With existing code in module 1 for sheet 1("Retail Bill") and existing code in Module 2 for sheet 2("Wholesale bill"). Can somebody show me how to transfer data from sheet 1 to Sheet 3 ("Entries") and from Sheet 2 to Sheet 3("Entries") in next empty row.
I mean just transfer code....
Sheet 1 to sheet 3
Sheet 2 to sheet 3
Both go to same sheet 3.
The existing codes are working fine but get pasted in there own sheet (Sheet 1 to sheet1) & (Sheet2 to sheet2). I want the data from both sheets to go to sheet3 ("Entries").
Just need paste Destination code with the existing codes.

Please somebody answer,
Regards,
mukhtar
File already attached in previous letter
 
Like this?
Code:
Sub belle()
With Sheets("Retail Bill")
    For i = .Cells(Rows.Count, 27).End(xlUp).Row To 3 Step -1
            .Range("AA" & i & ":AQ" & i).Copy Sheets("Entries").Cells(Rows.Count, 27).End(xlUp).Offset(1)
            .Cells(i, 7).EntireRow.Delete 'transfered cells will be deleted
    Next
End With
With Sheets("Wholesale Bill")
    For i = .Cells(Rows.Count, 27).End(xlUp).Row To 3 Step -1
            .Range("AA" & i & ":AQ" & i).Copy Sheets("Entries").Cells(Rows.Count, 27).End(xlUp).Offset(1)
            .Cells(i, 7).EntireRow.Delete 'transfered cells will be deleted
    Next
End With
End Sub
See attached.
 

Attachments

  • Invoice_Sample (belle).xlsb
    44.7 KB · Views: 6
Back
Top