Copy Paste - Excel
Solved/Closed
ITTrainee
-
Apr 28, 2010 at 12:14 PM
rizvisa1
rizvisa1
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Related:
- Copy Paste - Excel
- How to copy and paste excel sheet - Guide
- Compare two worksheets and paste differences to another sheet - excel vba free download ✓ - Forum - Excel
- Macro to compare 2 sheets and copy differences ✓ - Forum - Excel
- VBA Compare 2 sheets and output difference to 3rd sheet - Forum - Excel
- Excel vba create new workbook and paste data ✓ - Forum - Excel
1 reply
rizvisa1
Apr 28, 2010 at 12:27 PM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Apr 28, 2010 at 12:27 PM
Not clear on there are a list of dates in columns G & I as further down you are saying that there are three dates that need to go to 3 column but G & I makes two. I am presuming you meant G, H and I and that you want each row to be copied on a new sheet.
This should give you a good idea
This should give you a good idea
Sub createReports() Dim lMaxRows As Long Dim lThisRow As Long Dim sDataSheet As String 'name of the data sheet or main sheet sDataSheet = "Sheet1" Sheets(sDataSheet).Select ' max number of rows lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row 'stopping refresh of screen Application.ScreenUpdating = False 'processing the rows starting from 2 to end For lThisRow = 2 To lMaxRows Sheets.Add Range("A1") = Sheets(sDataSheet).Range("A" & lThisRow).Value Range("B1") = Sheets(sDataSheet).Range("G" & lThisRow).Value Range("C1") = Sheets(sDataSheet).Range("H" & lThisRow).Value Range("D1") = Sheets(sDataSheet).Range("I" & lThisRow).Value Next lThisRow Sheets(sDataSheet).Select 'starting refresh of screen Application.ScreenUpdating = True 'allow events to be completed DoEvents End Sub