Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I edit a cell in Excel without clicking on the cell first? | Excel Worksheet Functions | |||
how do i copy data from one sheet to another by d clicking a cell | Excel Discussion (Misc queries) | |||
How do i execute a VBA function by clicking on an excel cell? | Excel Discussion (Misc queries) | |||
How to highlight an Excel row by clicking on a cell | Excel Worksheet Functions | |||
copy one to cell to another by clicking and dragging | Excel Worksheet Functions |