Selecting rows in excel
Closed
Nic
-
Mar 26, 2010 at 06:48 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 26, 2010 at 11:02 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 26, 2010 at 11:02 AM
Related:
- Selecting rows in excel
- Excel mod apk for pc - Download - Spreadsheets
- Gif in excel - Guide
- Kernel for excel repair - Download - Backup and recovery
- Number to words in excel - Guide
- Vat calculation excel - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Mar 26, 2010 at 11:02 AM
Mar 26, 2010 at 11:02 AM
Assumptions
1. Data is on sheet1
2. rows are to be copied on sheet2
1. Data is on sheet1
2. rows are to be copied on sheet2
Sub moveRows()
Dim lMaxRows As Long
Dim rowIdx As Long
Dim inString As String
Dim lbeanCounter As Integer
Sheets("Sheet1").Select
lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
lbeanCounter = 1
For rowIdx = 2 To lMaxRows
Sheets("Sheet1").Select
inString = Trim(Cells(rowIdx, "A"))
If Len(inString) = 4 Then
lbeanCounter = lbeanCounter + 1
Rows(rowIdx).Select
Selection.Copy
Sheets("Sheet2").Select
Rows(lbeanCounter).Select
ActiveSheet.Paste
End If
Next
End Sub