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
- Number to words in excel - Guide
- Gif in excel - Guide
- Marksheet in excel - Guide
- Excel mod apk for pc - Download - Spreadsheets
- How to take screenshot in 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