Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, this macro is supposed to copy all the rows with a specific value (in
C25) to another sheet. But, only the first row will be copied. Can someone help?? Or have a better suggestion?? Sub Copy() Application.ScreenUpdating = False With Sheets("Sheet1") Dim i As Long, sTargetValue As String sTargetValue = Sheets("Sheet1").Range("C25") For i = 100 To 1 Step -1 If Cells(i, "A").Text = sTargetValue Then Rows(i).Select Selection.Copy Sheets("Sheet2").Select Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Sheets("Sheet1").Select End If Next i End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I copy specific rows without copying each row individually | Excel Worksheet Functions | |||
Sum specific column rows based on 2 different column criteria | Excel Worksheet Functions | |||
Copy / paste only specific rows | Excel Discussion (Misc queries) | |||
COPY AND PASTE SPECIFIC ROWS | Excel Discussion (Misc queries) | |||
Macro to copy down specific number of rows | Excel Programming |