在Excel 2010中,我想创建一个包含多个工作表的工作簿,工作表1将是我的数据输入页面,名称,地址,城市,州,邮编,电话号码,注释1,注释2,注释3,注释4,注意5.我想要一些指定的信息然后填充在其他工作表上。并非所有工作表都将使用所有信息,并且信息将放置在与数据表中的工作表1不同的行和单元格中。信息将重复,与第1页中输入的信息无关。
答案 0 :(得分:2)
好
您可以尝试使用宏,如果您尝试按工作表名称填充其他工作表过滤器,则可以使用以下内容:
Sub Filter_info()
Dim i As Integer, iLR As Integer
Dim sName As String, sSName() As String
Dim vSName As Variant
Dim Wkb As Workbook, Wks As Worksheet, WksC As Worksheet
Set Wkb = Workbooks("workbook_name")
Set Wks = Wkb.Worksheets("shee1_Name")
x = 0
'' create Worksheets list
For Each vSName In Worksheets
sName = vSName.Name
ReDim Preserve sSName(x)
sSName(x) = sName
x = x + 1
Next
iLR = Range("A1").End(xlDown).Row
For i = 0 To UBound(sSName)
Set WksC = Wkb.Worksheets(sSName(i))
y = 1
For j = 1 To iLR
'' Here you can decide with which cell you are going to compare
If sSName(i) = Wks.Range("A1") Then
Wks.Range("A1").Copy WksC.Cells(y, 1)
y = y + 1
End If
Next j
Next i
End Sub
答案 1 :(得分:0)
我的示例代码假定Sheet1!A1是您要复制的单元格。您需要做的就是键入
=Sheet1!A1
到目标单元格