![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Good afternoon all,
I'm failing miserably to get the below macro to leave the data in the first two columns when a new row is inserted and the cell contents are cleared. Is there a line I can insert that basically says clear everything but leave the values that were in columns A and B. Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True 'Eliminate Edit status due to doubleclick Target.Offset(1).EntireRow.Insert Target.EntireRow.Copy Target.Offset(1).EntireRow On Error Resume Next Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents On Error GoTo 0 End Sub Code:
Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents Any help would be greatly appreciated. Regards, Emsa |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro - Copying and Pasting selected slides (based on selected keywords/criteria) Hi | erickhawe | PowerPoint | 0 | 08-16-2019 09:00 PM |
![]() |
ganesang | Word VBA | 29 | 08-12-2018 09:38 PM |
Need macro for automatic point value insertion based on the number of answer choices selected | ganesang | Word | 1 | 07-31-2018 06:07 AM |
a macro that can copy data from copy.xls to our current excel macro.xls based on criteria: | udhaya | Excel Programming | 1 | 11-12-2015 10:12 AM |
Need macro to fill data from different sheets based on selected item from drop down | skorasika | Excel Programming | 1 | 03-13-2015 11:25 AM |