Looking for some help please. I'm not a coder and i've tried a couple of different youtube videos but i can't get them to work. I have a spreadsheet where I store information on my business working hours, prices etc. I'd like to be able to have data pulled from the main sheet ("income" sheet1) based on the Invoice number (the same invoice number appears on multiple rows) and put into an invoice which is also formatted in excel.
So if the "invoice" spreadsheet (sheet 5), if cell G4 (for example is I111) matches any of the data in the first column of the "income" spreadsheet (sheet 1) (starting at row 6) then the corresponding data in columns 3, 8, 4 & 9 will copy over to the "invoice" spreadsheet in columns 2, 3, 4 & 7 (starting at row 13).
Then just because i like to make life really difficult, is there a way to press a button and the invoice spreadsheet to pop into a new workbook ready to be sent to customers.
Many thanks for any help you may be able to give. This is the code i have to start. If i could get it to work to copy data from just one column to another i was going to repeat the code separatly for each of the other columns.
Sub finddata()
Dim datasheet As Worksheet
Dim reportsheet As Worksheet
Dim invoice As String
Dim finalrow As Integer
Dim i As Integer
Set datasheet = Sheet1
Set reportsheet = Sheet5
invoice = reportsheet.Range("g4").Value
reportsheet.Range("B13:b27").ClearContents
datasheet.Select
finalrow = Cells(Rows.Count, 1).End(x1up).Row
For i = 1 To finalrow
If Cells(i, 1) = invoice Then
(Cells(i, 3)).Copy
reportsheet.Select
Range("b27").End(x1up).Offset(1, 0).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
End If