Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The indicated part of the following code needs to be modified in such a
way that the row of the double clicked cell is duplicated for editing. There are no formulae involved. The new row is to be inserted directly below the active cell. Private Sub Worksheet_BeforeDoubleClick _ (ByVal Target As Range, Cancel As Boolean) On Error GoTo err_handler With Target If Not Intersect(Target, Range("N2:N6")) Is Nothing Then If Not IsEmpty(.Value) Then ThisWorkbook.FollowHyperlink ThisWorkbook.Path _ & "\" & .Value End If End If '------------------ This is the code of interest ------------------ If .Row 8 Then Range(Cells(ActiveCell.Row, "A"), _ Cells(ActiveCell.Row, "Z")).Insert xlDown Range("B" & ActiveCell.Row).Select On Error GoTo 0 End If '----------------------------------------------------------------------------- End With Exit Sub err_handler: MsgBox "An error has been made" & vbCrLf _ & "File name not recognised.", _ vbExclamation, "Error Notice" End Sub All suggestions gratefully received. Geoff |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Rowan.... That works a treat....
Geoff |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If .Row 8 Then
Cells(.Row,1).Resize(1,26).Offset(1,0).Insert Shift:=xlDown Cells(.Row,1).Resize(1,26).Offset(1,0).Filldown On Error GoTo 0 End If -- Regards, Tom Ogilvy wrote in message oups.com... The indicated part of the following code needs to be modified in such a way that the row of the double clicked cell is duplicated for editing. There are no formulae involved. The new row is to be inserted directly below the active cell. Private Sub Worksheet_BeforeDoubleClick _ (ByVal Target As Range, Cancel As Boolean) On Error GoTo err_handler With Target If Not Intersect(Target, Range("N2:N6")) Is Nothing Then If Not IsEmpty(.Value) Then ThisWorkbook.FollowHyperlink ThisWorkbook.Path _ & "\" & .Value End If End If '------------------ This is the code of interest ------------------ If .Row 8 Then Range(Cells(ActiveCell.Row, "A"), _ Cells(ActiveCell.Row, "Z")).Insert xlDown Range("B" & ActiveCell.Row).Select On Error GoTo 0 End If '--------------------------------------------------------------------------- -- End With Exit Sub err_handler: MsgBox "An error has been made" & vbCrLf _ & "File name not recognised.", _ vbExclamation, "Error Notice" End Sub All suggestions gratefully received. Geoff |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And Thank you Tom too.
That works a treat as well. Geoff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
duplicate | Excel Discussion (Misc queries) | |||
Duplicate | Excel Worksheet Functions | |||
How do you delete duplicate addresses, but keep duplicate names? | Excel Discussion (Misc queries) | |||
duplicate | Excel Discussion (Misc queries) | |||
Duplicate | Excel Worksheet Functions |