Hi everyone
Can someone assist me with using VB to insert a new row above a cell containing the word "Asset"?
I've attached a copy of my spreadsheet if that helps!
Thanks
Emma
Hi everyone
Can someone assist me with using VB to insert a new row above a cell containing the word "Asset"?
I've attached a copy of my spreadsheet if that helps!
Thanks
Emma
Emma
Try this:
Option Explicit Sub emma() Dim lr As Long lr = Range("A" & Rows.Count).End(xlUp).Row Dim i As Long Application.ScreenUpdating = False For i = lr To 5 Step -1 If Range("A" & i).Value Like "Asset*" Then Range("A" & i).EntireRow.Insert End If Next i Application.ScreenUpdating = True MsgBox ("complete") End Sub
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Hi - sorry, thought I'd replied but obviously mucked up somewhere! Solution is perfect, thanks so much for your help
One question: This code inserts a row with formatting. If you want a completely blank row without formatting, how would you change the code?
@excelactuary
Administrative Note:
Welcome to the forum.
We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original. Please start a new thread - See Forum rule #4
If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks