VBA to count fill cell

jmazorra

Well-known Member
Joined
Mar 19, 2011
Messages
715
Hello:

I am looking for a VBA that will count the number of filled cells in column A starting from row A2 (A1 has headers) down and then insert the same amount of rows in sheet 1, sheet 2 and sheet 3 starting at row A7 for all 3.

Any help will be appreciated.
 
Code:
Sub Copy_Status_Report()
    
    Dim rng As Range, ws As Worksheet
    
    Application.ScreenUpdating = False
    
    With Sheets("Status Report")
        Set rng = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
    End With
    
    For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
        ws.Rows(7).Resize(rng.Count).Insert
        rng.Copy Destination:=ws.Range("A7")
    Next ws
    
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    
End Sub
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Awesome, it saved me so much time and cut down on alot of errors.

I appreciate your patience and help
 
Upvote 0

Forum statistics

Threads
1,224,879
Messages
6,181,530
Members
453,054
Latest member
ezzat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top