excel列中相同的日期如何合并到不同的单独列?
发布网友
发布时间:2022-04-29 16:40
我来回答
共3个回答
热心网友
时间:2023-10-20 05:35
一个很简单的用数据透视表最基本的格式就可方便地达成目的的问题,被两个已回答的人说得那么复杂,还得用VBA。当然VBA可以实现,但一般说来,能够用基本的操作就可完成的,就不必用VBA了。
插入数据透视表,把编号、供应商都拖行字段区域,时间拖到列字段区域,数量拖到汇总区域,透视表的专用菜单设计中,布局选择表格,再删除行和列的汇总,就OK了。
热心网友
时间:2023-10-20 05:36
你这个还得转换格式排版,可以使用代码来实现
热心网友
时间:2023-10-20 05:36
Sub TEXT()
Dim RNG As Range, RNG1 As Range, RNG2 As Range, RNG3 As Range
Range("F2", Cells(Rows.Count, "I")).ClearContents
Set RNG = Range("A2", [A2].End(xlDown)) 'rng原始物料编码的集合
Set RNG1 = Range("A2:D2") 'RNG1原始行内容的集合
For Each RNG2 In RNG 'RNG2是rng的循环
Set RNG3 = Range("F:F").Find(RNG2.Value)
If RNG3 Is Nothing Then
Cells(Rows.Count, "F").End(xlUp)(2, 1) = RNG2
Set RNG4 = Cells(Rows.Count, "F").End(xlUp)
RNG4(1, 2) = RNG2(1, 2)
Cells(RNG4.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
Else
Cells(RNG3.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
End If
Next
End Sub追问---------------------------
Microsoft Visual Basic for Applications
---------------------------
运行时错误 '91':
对象变量或 With 块变量未设置
---------------------------
确定 帮助
---------------------------
运行时出现错误
热心网友
时间:2023-10-20 05:35
一个很简单的用数据透视表最基本的格式就可方便地达成目的的问题,被两个已回答的人说得那么复杂,还得用VBA。当然VBA可以实现,但一般说来,能够用基本的操作就可完成的,就不必用VBA了。
插入数据透视表,把编号、供应商都拖行字段区域,时间拖到列字段区域,数量拖到汇总区域,透视表的专用菜单设计中,布局选择表格,再删除行和列的汇总,就OK了。
热心网友
时间:2023-10-20 05:36
你这个还得转换格式排版,可以使用代码来实现
热心网友
时间:2023-10-20 05:36
Sub TEXT()
Dim RNG As Range, RNG1 As Range, RNG2 As Range, RNG3 As Range
Range("F2", Cells(Rows.Count, "I")).ClearContents
Set RNG = Range("A2", [A2].End(xlDown)) 'rng原始物料编码的集合
Set RNG1 = Range("A2:D2") 'RNG1原始行内容的集合
For Each RNG2 In RNG 'RNG2是rng的循环
Set RNG3 = Range("F:F").Find(RNG2.Value)
If RNG3 Is Nothing Then
Cells(Rows.Count, "F").End(xlUp)(2, 1) = RNG2
Set RNG4 = Cells(Rows.Count, "F").End(xlUp)
RNG4(1, 2) = RNG2(1, 2)
Cells(RNG4.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
Else
Cells(RNG3.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
End If
Next
End Sub追问---------------------------
Microsoft Visual Basic for Applications
---------------------------
运行时错误 '91':
对象变量或 With 块变量未设置
---------------------------
确定 帮助
---------------------------
运行时出现错误
热心网友
时间:2023-10-20 05:35
一个很简单的用数据透视表最基本的格式就可方便地达成目的的问题,被两个已回答的人说得那么复杂,还得用VBA。当然VBA可以实现,但一般说来,能够用基本的操作就可完成的,就不必用VBA了。
插入数据透视表,把编号、供应商都拖行字段区域,时间拖到列字段区域,数量拖到汇总区域,透视表的专用菜单设计中,布局选择表格,再删除行和列的汇总,就OK了。
热心网友
时间:2023-10-20 05:36
你这个还得转换格式排版,可以使用代码来实现
热心网友
时间:2023-10-20 05:35
一个很简单的用数据透视表最基本的格式就可方便地达成目的的问题,被两个已回答的人说得那么复杂,还得用VBA。当然VBA可以实现,但一般说来,能够用基本的操作就可完成的,就不必用VBA了。
插入数据透视表,把编号、供应商都拖行字段区域,时间拖到列字段区域,数量拖到汇总区域,透视表的专用菜单设计中,布局选择表格,再删除行和列的汇总,就OK了。
热心网友
时间:2023-10-20 05:36
你这个还得转换格式排版,可以使用代码来实现
热心网友
时间:2023-10-20 05:36
Sub TEXT()
Dim RNG As Range, RNG1 As Range, RNG2 As Range, RNG3 As Range
Range("F2", Cells(Rows.Count, "I")).ClearContents
Set RNG = Range("A2", [A2].End(xlDown)) 'rng原始物料编码的集合
Set RNG1 = Range("A2:D2") 'RNG1原始行内容的集合
For Each RNG2 In RNG 'RNG2是rng的循环
Set RNG3 = Range("F:F").Find(RNG2.Value)
If RNG3 Is Nothing Then
Cells(Rows.Count, "F").End(xlUp)(2, 1) = RNG2
Set RNG4 = Cells(Rows.Count, "F").End(xlUp)
RNG4(1, 2) = RNG2(1, 2)
Cells(RNG4.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
Else
Cells(RNG3.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
End If
Next
End Sub追问---------------------------
Microsoft Visual Basic for Applications
---------------------------
运行时错误 '91':
对象变量或 With 块变量未设置
---------------------------
确定 帮助
---------------------------
运行时出现错误
热心网友
时间:2023-10-20 05:36
Sub TEXT()
Dim RNG As Range, RNG1 As Range, RNG2 As Range, RNG3 As Range
Range("F2", Cells(Rows.Count, "I")).ClearContents
Set RNG = Range("A2", [A2].End(xlDown)) 'rng原始物料编码的集合
Set RNG1 = Range("A2:D2") 'RNG1原始行内容的集合
For Each RNG2 In RNG 'RNG2是rng的循环
Set RNG3 = Range("F:F").Find(RNG2.Value)
If RNG3 Is Nothing Then
Cells(Rows.Count, "F").End(xlUp)(2, 1) = RNG2
Set RNG4 = Cells(Rows.Count, "F").End(xlUp)
RNG4(1, 2) = RNG2(1, 2)
Cells(RNG4.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
Else
Cells(RNG3.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
End If
Next
End Sub追问---------------------------
Microsoft Visual Basic for Applications
---------------------------
运行时错误 '91':
对象变量或 With 块变量未设置
---------------------------
确定 帮助
---------------------------
运行时出现错误
热心网友
时间:2023-10-20 05:35
一个很简单的用数据透视表最基本的格式就可方便地达成目的的问题,被两个已回答的人说得那么复杂,还得用VBA。当然VBA可以实现,但一般说来,能够用基本的操作就可完成的,就不必用VBA了。
插入数据透视表,把编号、供应商都拖行字段区域,时间拖到列字段区域,数量拖到汇总区域,透视表的专用菜单设计中,布局选择表格,再删除行和列的汇总,就OK了。
热心网友
时间:2023-10-20 05:36
你这个还得转换格式排版,可以使用代码来实现
热心网友
时间:2023-10-20 05:36
Sub TEXT()
Dim RNG As Range, RNG1 As Range, RNG2 As Range, RNG3 As Range
Range("F2", Cells(Rows.Count, "I")).ClearContents
Set RNG = Range("A2", [A2].End(xlDown)) 'rng原始物料编码的集合
Set RNG1 = Range("A2:D2") 'RNG1原始行内容的集合
For Each RNG2 In RNG 'RNG2是rng的循环
Set RNG3 = Range("F:F").Find(RNG2.Value)
If RNG3 Is Nothing Then
Cells(Rows.Count, "F").End(xlUp)(2, 1) = RNG2
Set RNG4 = Cells(Rows.Count, "F").End(xlUp)
RNG4(1, 2) = RNG2(1, 2)
Cells(RNG4.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
Else
Cells(RNG3.Row, Range("H1:I1").Find(RNG2(1, 3)).Column) = RNG2(1, 4)
End If
Next
End Sub追问---------------------------
Microsoft Visual Basic for Applications
---------------------------
运行时错误 '91':
对象变量或 With 块变量未设置
---------------------------
确定 帮助
---------------------------
运行时出现错误