autofill values specific columns based on another column continuously

Alaa mg

Active Member
Joined
May 29, 2021
Messages
343
Office Version
  1. 2019
hi
I have this data in sheet1
1.xlsx
ABCDEF
1
2INVNO
3QW12
4dateCUSTOMER
501/01/2021ASD1
6
7
SHEET1

sheet2 before result
1.xlsx
ABCDEFG
1ITEMDATECOMMEDITYMADE IN INV NOPRCUSTOMER
21AA-12CHIASS1
32AA-13JAPASS2
43AA-14THIASS3
54AA-15TRASS4
SHEET2


and expected result in sheet2
1.xlsx
ABCDEFG
1ITEMDATECOMMEDITYMADE IN INV NOPRCUSTOMER
2101/01/2021AA-12CHIQW12ASS1ASD1
3201/01/2021AA-13JAPQW12ASS2ASD1
4301/01/2021AA-14THIQW12ASS3ASD1
5401/01/2021AA-15TRQW12ASS4ASD1
SHEET2

so it should copy theses values are in sheet1 (b5,d4,f5) to sheet 2 repeatedly in COLS (A,B,G) based on what filled in COL C
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi, according to your attachment a VBA demonstration as a beginner starter :​
VBA Code:
Sub Demo1()
    With [Sheet2!A1].CurrentRegion.Rows
        With .Item("2:" & .Count).Columns
             .Item(2) = [Sheet1!B5]
             .Item(5) = [Sheet1!D3]
             .Item(7) = [Sheet1!F5]
        End With
    End With
End Sub
 
Upvote 0
Solution
it's very impressive ! I surprised from this code just a bit lines do that
thanks so much :)
 
Upvote 0

Forum statistics

Threads
1,213,563
Messages
6,114,329
Members
448,564
Latest member
ED38

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