How to Inserting rows above specified cell

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
 
J

Jacob Skaria

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
 

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

Top