ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to line up rows (https://www.excelbanter.com/excel-programming/443605-macro-line-up-rows.html)

missy[_2_]

Macro to line up rows
 
Hi,

Please help:

How do I write a macro that will line up the rows if for example cells
A5 = D7.

That is, if cell A5 is the same as cell D7, then I want to:
Range("A5:C6").Select
Selection.Insert Shift:=xlDown

I want to do this for all values in column A starting with A5.

Thank you.

Don Guillett Excel MVP

Macro to line up rows
 
On Sep 14, 4:53*am, missy wrote:
Hi,

Please help:

How do I write a macro that will line up the rows if for example cells
A5 = D7.

That is, if cell A5 is the same as cell D7, then I want to:
* * Range("A5:C6").Select
* * Selection.Insert Shift:=xlDown

I want to do this for all values in column A starting with A5.

Thank you.


"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."


All times are GMT +1. The time now is 06:11 PM.

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