Hi,
I am trying to rearrange columns and rows in a worksheet. I am using below code to automate the process. It worked seamlessly when I ran the code on same worksheet. However when I cut and paste to another worksheet It doesn't run properly.
It cut c ell E3 and F3 from Sta Sheet however it only copy to cell Summary B4 and Summary B12. I want it to paste to B4:B11 and B12:B19. Can anyone help me modify the code so it paste to entire range.
Worksheet Sta is Source Data
Worksheet Summary is where i want to cut and paste the ranges.
I am trying to rearrange columns and rows in a worksheet. I am using below code to automate the process. It worked seamlessly when I ran the code on same worksheet. However when I cut and paste to another worksheet It doesn't run properly.
It cut c ell E3 and F3 from Sta Sheet however it only copy to cell Summary B4 and Summary B12. I want it to paste to B4:B11 and B12:B19. Can anyone help me modify the code so it paste to entire range.
Worksheet Sta is Source Data
Worksheet Summary is where i want to cut and paste the ranges.
Code:
Sub MoveRangeSta()
Dim iCntr
Dim rng As Range
Set rng = Worksheets("Summary").Range("C4:F1111")
For iCntr = rng.Row + rng.Rows.Count - 1 To rng.Row Step -1
If Application.WorksheetFunction.CountA(Rows(iCntr)) = 0 Then Rows(iCntr).EntireRow.Delete
Next
Worksheets("Sta").Range("C4:C12").Cut Destination:=Worksheets("Summary").Range("C4")
Worksheets("Sta").Range("E4:E12").Cut Destination:=Worksheets("Summary").Range("D4")
Worksheets("Sta").Range("C4:C12").Cut Destination:=Worksheets("Summary").Range("C12")
Worksheets("Sta").Range("F4:F12").Cut Destination:=Worksheets("Summary").Range("D12")
Worksheets("Sta").Range("E3").Cut Destination:=Worksheets("Summary").Range("B4:B11")
Worksheets("Sta").Range("F3").Cut Destination:=Worksheets("Summary").Range("B12:B19")
End Sub