我在工作表'SKU DATA'的单元格J2中具有以下vlookup公式...
=VLOOKUP(A2,DUPLICATE!C:AJ,34,0)
Run Code Online (Sandbox Code Playgroud)
但是,在“ DUPLICATE”工作表范围的第34列中,有2种可能的结果(最多只能有2种结果)。
Vlookup显示了第一个结果...是否可以在单元格J3中使用公式来显示第二个结果?
我看过几个match,index和small函数,但是,什么都无法工作?
谢谢
我有以下代码,它提供了三十天内的生产日期和生产量。
select
(case when trunc(so.revised_due_date) <= trunc(sysdate)
then trunc(sysdate) else trunc(so.revised_due_date) end) due_date,
(case
when (case when sp.pr_typ in ('VV','VD') then 'DVD' when sp.pr_typ in ('RD','CD')
then 'CD' end) = 'CD'
and (case when so.tec_criteria in ('PI','MC')
then 'XX' else so.tec_criteria end) = 'OF'
then sum(so.revised_qty_due)
end) CD_OF_VOLUME
from shop_order so
left join scm_prodtyp sp
on so.prodtyp = sp.prodtyp
where so.order_type = 'MD'
and so.plant = 'W'
and so.status_code between '4' and '8'
and trunc(so.revised_due_date) <= trunc(sysdate)+30
group by trunc(so.revised_due_date), …Run Code Online (Sandbox Code Playgroud) 我使用以下代码循环通过工作表1-31过滤每个工作表中的单元格中的值("E1")("RunFilter_2"),然后复制过滤范围并复制到工作表中的下一个空行( "RunFilter_2").
当它没有找到工作表的值("RunFilter_2")时的代码错误.活动工作表的第18列中的范围("E1").
所以我添加了一个范围检查,检查是否有工作表("RunFilter_2").范围("E1").值在列范围("R:R")中找到.
但是,如何移动到下一个如果rngFound什么都没有?
Sub RunFilter2()
Rows("5:5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
Set ws = wb.sheets("01")
Dim WS_Count As Integer
Dim I As Integer
WS_Count = ActiveWorkbook.Worksheets.Count - 3
For I = 1 To WS_Count
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
sheets(I).Select
Columns("A:U").Select
Dim rng As Range
Dim rngFound As Range
Set rng = Range("R:R")
Set rngFound = rng.Find(sheets("RunFilter_2").Range("E1").Value)
If rngFound Is Nothing Then
'----------------------------------
' …Run Code Online (Sandbox Code Playgroud)