Trying to write a code to insert a blank row above a cell value
Solved/Closed
Kwanni
Ambucias
- Posts
- 2
- Registration date
- Monday June 24, 2013
- Status
- Member
- Last seen
- June 26, 2013
Ambucias
- Posts
- 47363
- Registration date
- Monday February 1, 2010
- Status
- Moderator
- Last seen
- September 1, 2021
Related:
- Trying to write a code to insert a blank row above a cell value
- Excel vba insert multiple blank rows - Forum - Excel
- Insert number of rows based on cell value - Forum - Excel
- Vba code to insert rows based on cell value - Forum - Excel
- Excel vba insert picture from folder based on cell value - Forum - Excel
- How to insert blank rows using macros in Excel - Guide
3 replies
venkat1926
Jun 26, 2013 at 02:28 AM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Jun 26, 2013 at 02:28 AM
when you entere numbers without unnecessary space before or after the number
then run this macro
then run this macro
Sub test() Dim r As Range, cfind As Range, add As String Worksheets("sheet1").Cells.Clear Worksheets("sheet2").Cells.Copy Worksheets("sheet1").Range("A1") Worksheets("sheet1").Activate Dim j As Integer, k As Integer j = Range("A1").End(xlDown).Row For k = j To 1 Step -1 If Cells(k, 1) = 999 Then Cells(k, 1).EntireRow.Insert Next k End Sub
Ambucias
Jun 26, 2013 at 04:54 PM
- Posts
- 47363
- Registration date
- Monday February 1, 2010
- Status
- Moderator
- Last seen
- September 1, 2021
Jun 26, 2013 at 04:54 PM
Venkat is our home genius!
Kwanni
Jun 26, 2013 at 12:57 PM
- Posts
- 2
- Registration date
- Monday June 24, 2013
- Status
- Member
- Last seen
- June 26, 2013
Jun 26, 2013 at 12:57 PM
Thank you so much for taking the time to help me.
Saved me hours of work.
Saved me hours of work.