Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default In Excel 07. Copy to second cell by clicking f8irst?

I would like each cell in a column to duplicate the contents of each cell in
another column, but only when the latter (which already has contents) is
clicked. Is this possible? If so, can I install it and then use fill-down to
make the whole column work this way?

Can I do something like this but have the contents of one cell added to the
contents of a second cell on mouse-clicking the first?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default In Excel 07. Copy to second cell by clicking f8irst?

First question...........copy contents to a cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const myRange As String = "A1:A10"
'change to "A:A" for the column
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
If Target.Value < "" Then
Target.Offset(0, 1).Value = Target.Value
End If
End If
endit:
Application.EnableEvents = True
End Sub

Second question.............combine contents with contents of another cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const myRange As String = "A1:A10"
'change to "A:A" for the column
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
If Target.Value < "" Then
With Target.Offset(0, 1)
.Value = .Value & Target.Value
End With
End If
End If
endit:
Application.EnableEvents = True
End Sub

Note: you can't have two selectionchange events in the same worksheet.

You could change one of them to a BeforeDoubleClick event.


Gord Dibben MS Excel MVP

On Mon, 3 Dec 2007 15:52:00 -0800, Pgrudin
wrote:

I would like each cell in a column to duplicate the contents of each cell in
another column, but only when the latter (which already has contents) is
clicked. Is this possible? If so, can I install it and then use fill-down to
make the whole column work this way?

Can I do something like this but have the contents of one cell added to the
contents of a second cell on mouse-clicking the first?

Thanks.


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
How do I edit a cell in Excel without clicking on the cell first? Alisa Excel Worksheet Functions 5 April 2nd 07 07:15 PM
how do i copy data from one sheet to another by d clicking a cell YaYa Excel Discussion (Misc queries) 1 September 19th 06 05:25 PM
How do i execute a VBA function by clicking on an excel cell? Matthew Excel Discussion (Misc queries) 1 December 7th 05 01:10 AM
How to highlight an Excel row by clicking on a cell Marikay Excel Worksheet Functions 1 September 8th 05 02:47 PM
copy one to cell to another by clicking and dragging mozelle Excel Worksheet Functions 2 May 21st 05 02:30 PM


All times are GMT +1. The time now is 07:38 PM.

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

About Us

"It's about Microsoft Excel"