excellent, how about if you make a video to count every 5 or any number of rows to new sheet. means, copy from 1 to 5 row to new sheet and so on with out using step. make sure you add date in sheet1 before as wen you cop date to new sheet it will result numbers and not date format. Thanks a million👍
rng.Rows(i).Copy Sheet2.Range("A" & startrowsheet2) , this only copies one cell and pastes How do I copy the selected cell as well as one cell below it and specialpaste transpose it. Thank you for your video.
Hello, when I enter the script as above, it only counts 1 row and as such, does not copy. I'm using Windows 11, but I don't think it should have changed? I have also visited the link you attached and copy/paste the script in to check for typing errors on my side, but it gives me a compile error, variable not defined for the "A1" (Ln 11, Col 28). Please help-what am I missing?
Sir, in Excel we can drag /copy one formula ($C5:$D5 ) copy to ($G5:$H5) as a repetitive formula to ($C6:$M6) ($G6:$H6 ). how we can do the same in VBA I have a table that move data to another sheet once a button clicked ( they are 300 rows) there must be a way in VBA I want too resue the macro but in different cells reference Sub copyVprocess5() Dim wsCopy As Worksheet Dim wsDest As Worksheet Set wsCopy = Workbooks("RoadMap.xlsm").Worksheets("Employee List") Set wsDest = Workbooks(" RoadMap.xlsm").Worksheets("VProcess") wsCopy.Range("C5:M5").Copy wsDest.Range("D1045").End(xlUp).Offset(1, 0) Range("5:5").Rows.Hidden = True End Sub I want to repeat it for C6:M6 , C7:M7...etc)
This link will guide: www.exceltrainingvideos.com/copy-paste-data-repeatedly-from-sheet1-to-sheet2/ Or you can try a looping process like so: Sub copyVprocess5() Dim i As Long Dim wsCopy As Worksheet Dim wsDest As Worksheet Set wsCopy = Workbooks("RoadMap.xlsm").Worksheets("Employee List") Set wsDest = Workbooks("RoadMap.xlsm").Worksheets("VProcess") Worksheets("Employee List").Activate For i = 5 To 300 'wsCopy.Range("C5:F5").Copy wsDest.Range("D1045").End(xlUp).Offset(1, 0) wsCopy.Range(Cells(i, 3), Cells(i, 6)).Copy wsDest.Range("D1045").End(xlUp).Offset(1, 0) 'Range("5:5").Rows.Hidden = True Next i End Sub Keep the wsCopy.Range..... and wsDest.Range... in the same line of code.
Hi sir, I need a help from you.. For example I have two different files in 2 different folders. I file is a database which no body has access to and the other file every body has access. My question how I will update the data on a workbook which every one has access to every time I run a macro one after the other... Please help me sir this is very important for me... We collect feedback from customers but we can't give access of that file to every one... Hence I want the code in order to copy the data one after the other once the closed workbook gets updated.... Thank you
Sir, many thanks to you, i want to update excel file daily with macro to be run without opening it at all. i have doing same as you explain in 70,786 views •Dec 3, 2018
Sub CopyeveryNthROW() Dim i As Long, N As Long, countrows As Long, Startrowsheet2 As Long Dim Rng As Range Startrowsheet 2 = 1 N = 9 SetRng = Sheet1.Range("d1").CurrentRegion countrows = Rng.Rows.Count For i = 1 To countows Step N Rng.Rows(i).copysheet2.Range ("A" & Startrowsheet2) Startrowsheet2 = Startrowsheet2 + 1 Next i the code says sub or function not defined, I'm trying to copy my data from sheet 1 to sheet 8, column d, row 9th @Exceltrainingvideos @Dinesh Kumar Takyar Could you suggest where am i going wrong here, very new to vba
Try this, you have to create a worksheet named "Sheet8" (no quotes) in your Excel file before you run the code. Sub CopyeveryNthROW() Dim i As Long, N As Long, countrows As Long, Startrowsheet2 As Long Dim Rng As Range Startrowsheet2 = 9 N = 9 Set Rng = Sheet1.Range("A1").CurrentRegion countrows = Rng.Rows.Count 'MsgBox countrows For i = 1 To countrows Step N Rng.Rows(i).Copy Worksheets("Sheet8").Range("D" & Startrowsheet2) Startrowsheet2 = Startrowsheet2 + 1 Next i End Sub