copy specific cells & ranges from sheet to another

Mussa

Board Regular
Joined
Jul 12, 2021
Messages
237
Office Version
  1. 2019
  2. 2010
hi
this is the first post . I hope some help by vba actually I have no any experience.
I have some data in sheet1 . it represents data of invoice should copy specific cells (D2,C6,E6) repeatedly in sheet2 based on copied range from b10 to lastrow (G14) but be carefully I said lastrow this doesn't mean the end G14 it depends on how many items should fill may be G15 OR G16 and so on , then I insert new rows what I need it . also copy range from B10 :G14
note: RANGE(B10 :G14 & G17) are changable in location. I mean changing in last row in col G whether (GOODS,TYPE,PR) or ( NET ) and when copy the value is existed in , also should show G17 in the second row for each invoice and when copy another data of invoice should create a new header to break among the invoices
INVI.xlsm
ABCDEFG
1INVOICE NO
2FR-1000
3
4
5ORDER NO :DATE
6AS-100012/07/2021
7
8
9ITEMGOODSTYPEPRPRICEQTYTOTAL
101FD-122ASDQW1NN120.0013.00260.00
112FD-123ASDQW2NN215.00250.003,750.00
123FD-124ASDQW3NN312.0050.00600.00
134FD-125ASDQW4NN420.0060.001,200.00
145FD-126ASDQW5NN525.0080.002,000.00
15TOTALSUBTOTAL7810
16DISCOUNT12
17NET7798
18
sheet1
Cell Formulas
RangeFormula
G10:G14G10=E10*F10
G15G15=SUM(G10:G14)
G17G17=G15-G16


expected result
INVI.xlsm
ABCDEFGHIJK
1ITEMDATEINVOICE NOORDER NOGOODSTYPEPRPRICEQTYTOTALNET
2112/07/2021FR-1000AS-1000FD-122ASDQW1NN120.0013.00260.007,798.00
3212/07/2021FR-1000AS-1000FD-123ASDQW2NN215.00250.003,750.00
4312/07/2021FR-1000AS-1000FD-124ASDQW3NN312.0050.00600.00
5412/07/2021FR-1000AS-1000FD-125ASDQW4NN420.0060.001,200.00
6512/07/2021FR-1000AS-1000FD-126ASDQW5NN525.0080.002,000.00
7ITEMDATEINVOICE NOORDER NOGOODSTYPEPRPRICEQTYTOTALNET
8112/07/2021FR-1001AS-1001FD-127ASDQW6NN610.0050.00500.00790
9212/07/2021FR-1001AS-1001FD-128ASDQW7NN710.0020.00200.00
10312/07/2021FR-1001AS-1001FD-129ASDQW8NN810.0010.00100.00
11
RESULT
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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