Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Change cell value when right-clicked/double-clicked

sure, here you go

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

'sets the range for code to work in, this one works only in column A

If Union(Range("$A:$A"), Target).Address = Range("$A:$A").Address Then

' selects the active cell and then moves 10 columns to the right,
selects that cell and copies it

ActiveCell.Offset(0, 10).Range("A1").Select
Selection.Copy

'moves back to the left 10 columns and pastes

ActiveCell.Offset(0, -10).Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False

'moves down to the cell below

ActiveCell.Offset(1, 0).Range("A1").Select
End If


End Sub

right click on the sheet tab, select view code, from the dropdown menu
where it says ,general, select worksheet, enter the code above
Dave

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change cell value when right-clicked/double-clicked


damorrison Wrote:
sure, here you go


Thanks Dave. Exactly what I was looking for. Works perfectly.

And thanks to the others that replied. Much appreciated.


--
grime
------------------------------------------------------------------------
grime's Profile: http://www.excelforum.com/member.php...o&userid=19227
View this thread: http://www.excelforum.com/showthread...hreadid=476434

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
Change the chart when a cell is clicked SheriTingle Charts and Charting in Excel 2 April 1st 10 05:41 PM
Clicked NO to save, should have clicked YES Jenn Excel Discussion (Misc queries) 1 March 8th 10 09:04 PM
Excel files not opening when double clicked Dale Fye Excel Discussion (Misc queries) 4 March 15th 08 04:00 PM
Formula not displaying colored border when double clicked Joker Excel Discussion (Misc queries) 0 February 2nd 07 11:34 AM
VB6, How do i open (instead of edit) an excel OLE doc when it is double clicked? TexN Excel Programming 1 October 17th 05 12:04 PM


All times are GMT +1. The time now is 12:01 AM.

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"