Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default BeforeDoubleClick code

I would like to put a routine on the worksheet tab using "BeforeDoubleClick"
that would put the contents of the cell clicked on in A1 and the contents of
the cell (OFFSET 1,1) in cell A2.

Thanks,

Ronbo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default BeforeDoubleClick code

I assume you want the cell 1 row down and 1 row to the right of the double
clicked cell, right? If not just adjust the .Offset numbers.

Hope this helps! If so, let me know, click "YES" below.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Cancel = True

Range("A1").Value = Target.Value
Range("A2").Value = Target.Offset(1, 1).Value

End Sub
--
Cheers,
Ryan


"Ronbo" wrote:

I would like to put a routine on the worksheet tab using "BeforeDoubleClick"
that would put the contents of the cell clicked on in A1 and the contents of
the cell (OFFSET 1,1) in cell A2.

Thanks,

Ronbo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default BeforeDoubleClick code

Something like this perhaps. HTH Otto
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Range("A1") = Target
Range("A2") = Target.Offset(1, 1)
End Sub

"Ronbo" wrote in message
...
I would like to put a routine on the worksheet tab using
"BeforeDoubleClick"
that would put the contents of the cell clicked on in A1 and the contents
of
the cell (OFFSET 1,1) in cell A2.

Thanks,

Ronbo

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default BeforeDoubleClick code

Try either of these.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With ActiveCell
.Copy Range("A1")
.Offset(1, 1).Copy Range("A2")
End With
End Sub

or

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
ActiveCell.Copy Range("A1")
ActiveCell.Offset(1, 1).Copy Range("A2")
End Sub

HTH
Regards,
Howard

"Ronbo" wrote in message
...
I would like to put a routine on the worksheet tab using
"BeforeDoubleClick"
that would put the contents of the cell clicked on in A1 and the contents
of
the cell (OFFSET 1,1) in cell A2.

Thanks,

Ronbo



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to BeforeDoubleClick art Excel Programming 6 October 13th 08 03:46 AM
Help With BeforeDoubleClick jean Excel Programming 3 March 19th 08 07:02 PM
BeforeDoubleClick Stefi Excel Programming 7 December 20th 07 10:13 AM
beforedoubleclick and selectionchange clara Excel Programming 0 April 24th 07 06:52 PM
BeforeDoubleClick doesn't seem to work Dan Excel Programming 7 March 13th 07 03:22 AM


All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"