Posted to microsoft.public.excel.worksheet.functions
|
|
Data from two sheets make up real time list in the new sheet??
Thank you for quick answer. Looks like something that might work. The only
problem is that I'm not very familiar with programming in VB.
Could you give me some tips what I need to read about in order to solve this
problem; and what are parameters I need to change in your proposal?
Thanks once again.
--
Vedad
"excelent" skrev:
try:
Sub tst()
Dim t, r, nbr, mySets(100, 100) As Variant
nbr = 0
Sheets("Sheet1").Select
r = Range("A65500").End(xlUp).Row
For t = 1 To r
If Cells(t, 3) = "YES" Then
nbr = nbr + 1
mySets(nbr, 1) = Cells(t, 1)
mySets(nbr, 2) = Cells(t, 2)
mySets(nbr, 3) = Cells(t, 3)
mySets(nbr, 4) = Cells(t, 4)
End If
Next
Sheets("Sheet2").Select
r = Range("A65500").End(xlUp).Row
For t = 1 To r
If Cells(t, 3) = "YES" Then
nbr = nbr + 1
mySets(nbr, 1) = Cells(t, 1)
mySets(nbr, 2) = Cells(t, 2)
mySets(nbr, 3) = Cells(t, 3)
mySets(nbr, 4) = Cells(t, 4)
End If
Next
Sheets("Sheet3").Select
For t = 1 To nbr
Cells(t, 1) = mySets(t, 1)
Cells(t, 2) = mySets(t, 2)
Cells(t, 3) = mySets(t, 3)
Cells(t, 4) = mySets(t, 4)
Next
r = Range("A65500").End(xlUp).Row
Range("A1:D" & r).Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("B1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal
Range("A1").Select
End Sub
|