insert 'x' number of rows in excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm looking to insert 'x' no. of rows into an excel document where 'x' is
the result of a 'countA' function.

Is this possible?
 
How about:

Option Explicit
Sub testme()

Dim numOfRows As Long
Dim myRow As Long

myRow = 8 'or whereever you want it
With ActiveSheet
numOfRows = Application.CountA(.Range("a1:a3"))
If numOfRows > 0 Then
.Rows(myRow).Resize(numOfRows).Insert
End If
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top