Excel VB to Loop a copy and paste based upon a cell value
Posted on 2009-03-31
I have a sheet called "main" that has the following values in cells starting at cell B5. B5 has value of ItemNumber and cell C5 is HCI-1111, etc.
Line Number 1
TransactionTime 9:46:34 AM
In a second sheet named "createData" I have the 1st row with the following headings in Column A thru T.
ItemNumber ItemFiller Warehouse OrderNumber RMANumber Source ControlNumber Line Number LevelNumber SequenceNumber BINNumber TransactionDate TransactionTime Quantity Cost MfgrSeriallot Shipped SelectForShip PrintDate Username
I am looking for help in creating a VB macro that will copy the data on the "Main" sheet Column "C" to the "createData" sheet placing the data in the corresponding columns.
Now I want to be able to control the loop by a cell value, so if I need 100 rows copied with the same data I would enter the value 100 into Cell F5 on "main" sheet.
I know nothing about VB, I would need the script written.