Link a specific cell from new sheet to a Log Sheet Automatically.

hannakaram

New Member
Joined
Aug 9, 2019
Messages
6
I create a account Statement and Invoices Workbook File,
First sheet is the account Statement, and after each sheet will be a new invoice.
I want each time I add a new sheet as a new invoice, as Copy Paste, a specific data from a specific cells in that new invoice sheet will go automatically to the first blank or empty row in the statement sheet, without to link it one by one manually.
How I can do that.
I can send the file to see it.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Upload your book to the cloud and share it to put the macro.
Tell me which or which cells should be sent to the "account Statement" sheet

You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
Upload your book to the cloud and share it to put the macro.
Tell me which or which cells should be sent to the "account Statement" sheet

You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.

Thanks for your reply
Here is a link to the file,
https://www.dropbox.com/s/4ll0src44y3uf9d/My Client Company Name.xlsx?dl=0

Thanks
 
Upvote 0
But you didn't explain, which cells are taken from "Statement" and where they should be put in the new one.
 
Upvote 0
But you didn't explain, which cells are taken from "Statement" and where they should be put in the new one.

You can see the cells in the statement which is linked to the invoices
Example are in invoice #1 and Invoice #2
What I want is when I add Invoice #3 and more, same cells from invoices will go to the Statement

And in details will be as follow:

Invoice!H3 to Statement Column !A
Invoice!E3 to Statement Column !B
Invoice!G11 to Statement Column !C
Invoice!G12 to Statement Column !E
Invoice!I36 to Statement Column !I

So it is a specific Cells from the Invoices, but going to find them places in the first empty row in a specific Column

I am sure you understand what I need.

Thanks for your concern
 
Upvote 0
Try this.

Put the macro in a module, select the new invoice and run the macro.

Code:
Sub Fill_Statement()
  Dim sh As Worksheet, i As Long, f As Range
  Set sh = Sheets("Statement")
  
  If LCase(Left(ActiveSheet.Name, 7)) <> LCase("Invoice") Then
    MsgBox "This sheet is not an invoice"
    Exit Sub
  End If
  Set f = sh.Range("B:B").Find(Range("E3"), , xlValues, xlWhole)
  If Not f Is Nothing Then
    MsgBox "This invoice already exists"
    Exit Sub
  End If
  
  i = 19
  Do While sh.Cells(i, "A") <> ""
    i = i + 1
  Loop
  sh.Range("A" & i) = Range("H3")
  sh.Range("B" & i) = Range("E3")
  sh.Range("C" & i) = Range("G11")
  sh.Range("E" & i) = Range("G12")
  sh.Range("I" & i) = Range("I36")
  MsgBox "Registration added"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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