ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Insert a row above a certain cell (https://www.excelbanter.com/excel-discussion-misc-queries/72820-insert-row-above-certain-cell.html)

minrufeng

Insert a row above a certain cell
 

I am working hard on this simple problem (I think it's not difficult to
implement): insert a row above a certain

cell, for example, the value of the cell is "Total Revenues" using
Macro. Does anyone of you know how to do this?

Thanks a lot for your great help!


--
minrufeng
------------------------------------------------------------------------
minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208
View this thread: http://www.excelforum.com/showthread...hreadid=514583


Jim May

Insert a row above a certain cell
 
Using the Macro recorder:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/20/2006 by Jim May

Cells.Find(What:="Total Revenue", After:=ActiveCell, LookIn:=xlFormulas,
_
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.EntireRow.Insert
End Sub



"minrufeng" wrote
in message ...

I am working hard on this simple problem (I think it's not difficult to
implement): insert a row above a certain

cell, for example, the value of the cell is "Total Revenues" using
Macro. Does anyone of you know how to do this?

Thanks a lot for your great help!


--
minrufeng
------------------------------------------------------------------------
minrufeng's Profile:
http://www.excelforum.com/member.php...o&userid=26208
View this thread: http://www.excelforum.com/showthread...hreadid=514583




minrufeng

Insert a row above a certain cell
 

Cells.Find("Total Revenues").EntireRow.Insert


--
minrufeng
------------------------------------------------------------------------
minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208
View this thread: http://www.excelforum.com/showthread...hreadid=514583



All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com