Hello Guys
I don't often post as I can usually find the answer to any issue I have in other threads. On this particular occasion this is not the case.
I have a little block of code attached to a button that I intend to use to duplicate the selected row to a new line below it. The code achieves this nicely but I would prefer it if only the formatting and formulas were copied without the content if this is at all possible. I am sure it is but I have only a limited knowledge of VBA for Excel.
I also have something else I need somebody's help with. As mentioned, I have a button to perform the duplication of a selected row and since this sheet will be rather lengthy it would nice if my little button would reposition itself to the the same row as the selected cell only a couple of columns to the right of the data. I have seen this done before and I know it is achievable.
It would be greatly appreciated if any assistance can be offered for my two inquiries today. I will create a new thread for the second query if somebody is able to help so that others can search for it easily.
My row duplication code
Sub AddRow_Click()
Dim insertBelow As Range
Dim wks As Worksheet
Set insertBelow = ActiveCell
Set wks = insertBelow.Worksheet
insertBelow.Offset(1, 0).Select
insertBelow.Offset(1, 0).EntireRow.Insert
insertBelow.EntireRow.Copy
wks.Paste insertBelow.Offset(1, 0).EntireRow
Application.CutCopyMode = False
End Sub
Bookmarks