View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Coping a whole row to another sheet

Something like this (very generic code) should work for you
Sub newone()
Dim RngColF As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngColF = Range("B1", Range("B" & Rows.count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With
For Each i In RngColF
If i.Value = "Family" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

Obviously, change 'family' to the month you need, change the sheet names, etc.

You can experiment with this too...
Sub CopyData10()
Dim rng As Range, cell As Range
Dim rw As Long
Set rng = Worksheets("Copy Data3").Range("B1:B10")
rw = 1
For Each cell In rng
If LCase(cell.Value) = "x" Then
Worksheets("Copy Data4").Cells(rw, "A") = cell.Offset(0, -1)
rw = rw + 1
End If
Next
End Sub

Regards,
Ryan---

--
RyGuy


"daisy2008" wrote:

What would be the best way to creat a command button (on sheet "Report") that
will pull (from sheet "Report Data") only the month (colum AI) in which is
stated on sheet "Report" ActivCell F12. Insert the (whole row) results in a
new sheet at the end of the workbook or existing sheet "Monthly Report". Then
Hide colums D thru AE and AI, totaling Colums AF, AG and AH. Creating a
formual in a cell that will take the total in AH to see if it is over the
budget amount by dividing the annual budget number in sheet "Report" cell F10
by 12 then stating how much money is left for the year?