Hi there,
Greeting! I am trying to create macro which is copy the data multiple times same size for different color. Please check my excel sheet of before and after tab for more detail.
Regards,
james
Hi there,
Greeting! I am trying to create macro which is copy the data multiple times same size for different color. Please check my excel sheet of before and after tab for more detail.
Regards,
james
Re: I want to try create macro for copy the data multiple time
Try this for a start to see if it is acceptable ???
Results sheet2.
Sub MultRp()
'op2
Dim cRng As Range
Dim Dn As Range
Dim n As Long
Dim eRng As Range
Dim nRng As Range
Dim Lst As Long
Dim eA As Range
Dim cA As Range
Dim ac As Integer
Dim Bth As String
Dim A As Range
Dim c As Long
Dim R1 As Range
Dim p As Long
With Sheets("Before")
Lst = .Range("c" & Rows.Count).End(xlUp).Row
Set eRng = .Range("E:E").SpecialCells(xlCellTypeConstants, 2)
ReDim ray(1 To Lst * eRng.Count, 1 To 6)
Set cRng = .Range("C:C").SpecialCells(xlCellTypeConstants, 2)
End With
For Each cA In cRng.Areas
n = n + 1
p = 0
For Each eA In eRng.Areas(n)
p = p + 1
For Each A In cA
Set R1 = IIf(p > 1, A.Offset(1), A)
If Not R1 = "" Then
c = c + 1
For ac = 1 To 6
Bth = IIf(ac = 6, eA, R1.Offset(, ac - 3).Value)
ray(c, ac) = Bth
Next ac
End If
Next A
Next eA
For Each eA In eRng.Areas(n)
c = c + 1
ray(c, 5) = eA
Next eA
c = c + 1
Next cA
Sheets("Sheet2").Range("A1").Resize(c, 6) = ray
MsgBox "Run"
End sub
Display More
Re: I want to try create macro for copy the data multiple time
Re: I want to try create macro for copy the data multiple time
Try your returned File :-
Re: I want to try create macro for copy the data multiple time
Hi MickG,
Greeting! Many many thanks! Now the file working properly.
Regards,
James
Re: I want to try create macro for copy the data multiple time
You're welcome
Don’t have an account yet? Register yourself now and be a part of our community!