formula/function to copy from worksheet to worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I keep track of our company's inventory in a workbook using a worksheet
for each different warehouse location. I need to copy the rows from each
worsheet into another worksheet based on the amount of time the product has
been sitting in the warehouse. Is this possible? Or am I going to have to
manual copy the data?
 
It is possible.
Please give more details, which column contains the Date (or Time), and
after how much elasped number of Days (or Time) you want to copy to other
sheet.

Sharad
 
That is definitely doable. If you can give us the format of the data
of the time the product has been sitting in the warehouse would help
 
That is definitely doable. It would help if you could give us the
format of the time data on how long the items have been sitting in the
warehouse.
 
Column F is my total days on floor, and I would like to copy anything over
90days old to a another sheet. I am using Excel 2000. I have
 
See below code.
The below code assumes your data is in sheet named
"Sheet1" and you want to copy it in sheet named "Sheet2"
You can replace these names with your actual names of
sheets.

Sub CopyRows()
Dim cRange As Range, dRange As Range
Dim c
With Worksheets("Sheet1")
Set cRange = .UsedRange.Cells _
(.UsedRange.Rows.Count + 1, 1).EntireRow
Set dRange = .Range("F1:F" & .UsedRange.Cells _
(.UsedRange.Rows.Count, 1).Row)
End With
For Each c In dRange.Cells
If c.Value >= 90 Then
Set cRange = Union(cRange, c.EntireRow)
End If
Next c
cRange.Copy _
Destination:=Worksheets("Sheet2").Range("A1")

End Sub


Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top