Home |
Search |
Today's Posts |
#1
|
|||
|
|||
insert row within function
I need a formula that would insert a blank row above the row that contains a
specific value. ie, if a cell contains "x", insert a blank row above it. Or, the same in a macro. Thanks, chris |
#2
|
|||
|
|||
Here's a macro someone gave me........it will look for the word "Total" in
either column 3 (C) or column 8 (H) and if found will BOLD the text in that row and add a blank row ..... Sub AddRows() 'Adds blank rows to the sheet for easier reading 'Also changes font on the first 30 columns from the left to BOLD Dim lastrow As Long Dim r As Long lastrow = Range("x" & Rows.Count).End(xlUp).Row For r = lastrow To 2 Step -1 If InStr(1, Cells(r, 3).Value, "Total") 0 Or _ InStr(1, Cells(r, 8).Value, "Total") 0 Then Range(Cells(r, 1), Cells(r, 30)).Font.Bold = True '30 is number 'of columns from "A" that the macro will BOLD ActiveSheet.Rows(r + 1).EntireRow.Insert End If Next End Sub it can be run multiple times for more blank rows..........you can modify it to fit your purposes........ hth Vaya con Dios, Chuck, CABGx3 "c_sports" wrote in message ... I need a formula that would insert a blank row above the row that contains a specific value. ie, if a cell contains "x", insert a blank row above it. Or, the same in a macro. Thanks, chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Challenging Charting | Charts and Charting in Excel | |||
Can I change the Insert Function button to an equals sign? | Excel Discussion (Misc queries) | |||
Insert Function "FX" on Toolbar in Excel | Excel Discussion (Misc queries) | |||
How do I insert a row when using an if function | Excel Worksheet Functions | |||
Function to automatically insert a new sheet as a result of data entry? | Excel Worksheet Functions |