求助大佬!
excel吧
全部回复
仅看楼主
level 1
上锁の心 楼主
一个工作簿中有100+个工作表
我要做一个汇总,即提前每一个工作表中C4的数据
如何做下拉的公式
2022年01月07日 02点01分 1
level 1
上锁の心 楼主
2022年01月07日 02点01分 2
level 13
假设你各个工作表命名的规律分别是sheet1、sheet2……sheet100 那么你在汇总表的b2输入=indirect(“sheet”&row(a1)&“!$C$4”) 回车以后 拖住单元格下拉.
2022年01月07日 03点01分 3
level 11
'先在当前工作簿中新建一个"汇总"工作表后再运行
Option Explicit
Sub abc()
 Dim sht, m
 ReDim a(Sheets.Count - 1, 1 To 2)
 For Each sht In Sheets
  If sht.Name <> "汇总" Then m = m + 1: a(m, 2) = sht.[c4].Value
 Next
 a(0, 1) = "订单号": a(0, 2) = "日期"
 With Sheets("汇总")
  .[a:b].ClearContents
  .[b:b].NumberFormatLocal = "yyyy.mm.dd"
  .[a1].Resize(m + 1, 2) = a
 End With
End Sub
2022年01月07日 03点01分 4
好复杂呀,谢谢
2022年01月07日 03点01分
level 6
indirect函数吧,大概能达到你的目的,如果不能,再配合index、新建名称应该可以
2022年01月07日 03点01分 5
感谢
2022年01月07日 03点01分
level 12
以订单号为表号,在汇总表中查找各个表中的C4单元格数据
B2=INDIRECT(TEXT(A2,"'m-d'")&"!C4")
2022年01月07日 03点01分 6
谢谢,我搞定了
2022年01月07日 03点01分
level 11
If sht.Name <> "汇总" Then m = m + 1: a(m, 2) = sht.[c4].Value 修改一下:
If sht.Name <> "汇总" Then m = m + 1: a(m, 2) = sht.[c4].Value:a(m,1)=sht.name
2022年01月07日 03点01分 7
谢谢回复,搞定了
2022年01月07日 03点01分
level 1
上锁の心 楼主
感谢各位大佬
辛苦
搞定了[哈哈]
2022年01月07日 03点01分 8
1