Macros: Copy Invoice Details From One Sheet to Another
Solved/Closed
Jenny
-
Oct 19, 2016 at 11:20 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Oct 20, 2016 at 05:42 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Oct 20, 2016 at 05:42 AM
Related:
- Macro to copy data from one sheet to another based on criteria
- Transfer data from one excel worksheet to another automatically - Guide
- Google sheet right to left - Guide
- Excel macro to create new sheet based on value in cells - Guide
- How to reset safe folder password without losing data ✓ - Android Forum
- Windows network commands cheat sheet - Guide
3 responses
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Oct 19, 2016 at 09:57 PM
Oct 19, 2016 at 09:57 PM
Hello Jenny,
I assume that you would like to create an archive or register of all invoices created and sent out.
As I don't know the set out of your work book, I've made some assumptions and think that the following code may work for you:-
As I don't know in which cells the required data resides, in lines 12 and 13 of the above code, I've made up some cell references: L10 may be the invoice number, C10 may be the date and L9 may be the invoice value. You'll need to change these cell references to suit yourself.
(Do you perhaps also need to add the Customer name to the "Log" sheet?)
I've also assumed that the sheet names may be "Invoices" as the source sheet and "Log" as the destination sheet. Again change these to suit yourself. The above code also assumes that, in the "Log" sheet, Column A is for the Invoice number, Column B is for the date and Column C is for the value.
You can add the above code to the same module as your first code but call this code from your first one simply by placing the name of this code (SendToLog) just above End Sub in your first code.
If this is a little confusing for you, then please upload a sample of your work book to a free file sharing site such as DropBox, ge.tt or SpeedyShare then post the link to your file back here. We can then have a proper look at your query.
I hope that this helps,
Cheerio,
vcoolio.
I assume that you would like to create an archive or register of all invoices created and sent out.
As I don't know the set out of your work book, I've made some assumptions and think that the following code may work for you:-
Sub SendToLog() Dim WS1 As Worksheet Dim WS2 As Worksheet Set WS1 = Worksheets("Invoices") Set WS2 = Worksheets("Log") Application.ScreenUpdating = False NextRow = WS2.Cells(Rows.Count, 1).End(xlUp).Row + 1 WS2.Cells(NextRow, 1).Resize(1, 3).Value = Array(WS1.Range("L10"), WS1.Range("C10"), WS1.Range("L9")) Application.ScreenUpdating = True End Sub
As I don't know in which cells the required data resides, in lines 12 and 13 of the above code, I've made up some cell references: L10 may be the invoice number, C10 may be the date and L9 may be the invoice value. You'll need to change these cell references to suit yourself.
(Do you perhaps also need to add the Customer name to the "Log" sheet?)
I've also assumed that the sheet names may be "Invoices" as the source sheet and "Log" as the destination sheet. Again change these to suit yourself. The above code also assumes that, in the "Log" sheet, Column A is for the Invoice number, Column B is for the date and Column C is for the value.
You can add the above code to the same module as your first code but call this code from your first one simply by placing the name of this code (SendToLog) just above End Sub in your first code.
If this is a little confusing for you, then please upload a sample of your work book to a free file sharing site such as DropBox, ge.tt or SpeedyShare then post the link to your file back here. We can then have a proper look at your query.
I hope that this helps,
Cheerio,
vcoolio.