How to Inserting rows above specified cell

  • Thread starter Thread starter arun
  • Start date Start date
A

arun

Hi All,

I wanted to insert rows above the specified cell (consider 'A12') .

Example:
A1-this
A2-That
---
---
A12- Total

So i wanted to insert rows above this 'A12' cell range

Please help me on this.

Thanks
 
Hi Arun

--If you want to insert a row above A1;the below one line will do.
Rows(12).Insert

--The below macro will find the cell value 'Total' and insert a row on top
of that row..

Sub Macro()
Dim varFound As Variant
Set varFound = ActiveSheet.Range("A:A").Find("Total", _
LookIn:=xlValues)
Rows(varFound.Row).Insert
End Sub

If this post helps click Yes
 
Back
Top