View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Zak Zak is offline
external usenet poster
 
Posts: 144
Default If Statement..i think

Hello

This is great, the code you have given me works!! I was wondering if you
can help me add 2 more things to it:

1) How can i get the row in sheet one to get deleted once it has been copied
over to sheet 7?

1) In sheet 7, id like row 1 to have a heading, so rows copied over from
sheet 1, should then go into row 2 onwards?

Here is the code which I have:

Sub Macro()
'Sheet1 .....all data..
'Sheet7......contains filtered data
Dim i, j, n As Integer
j = 1
Sheet1.Activate
For i = 1 To Sheet1.UsedRange.Rows.Count
If (Cells(i, 8) = "Complete") Then
For n = 1 To Sheet1.UsedRange.Columns.Count
Sheet7.Cells(j, n) = Sheet1.Cells(i, n)
Next n
j = j + 1
End If
Next i
End Sub

Thanks for your help.

"aamerrasheed" wrote:

Hi,
You can use this...

Sub Macro()
'Sheet3 .....all data..
'Sheet2......contains filtered data
Dim i, j, n As Integer
j = 1
Sheet3.Activate
For i = 1 To Sheet3.UsedRange.Rows.Count
If (Cells(i, 8) = "Complete") Then
For n = 1 To Sheet3.UsedRange.Columns.Count
Sheet2.Cells(j, n) = Sheet3.Cells(i, n)
Next n
j = j + 1
End If
Next i
End Sub


zak wrote:
Yes a drop down list with two options; Complete or Pending..as in the one you
can create via Data - Data Validation - Allow: List

Drop down?

[quoted text clipped - 12 lines]

Thank you