Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy selected cells
I have what I think is an easy one.
I have a sheet that has about 500 rows. In Column A everything is blank. In Column B maybe blank, but there are some notes in some of the cells. What I'm trying to do is IF, there are notes in cell B10 for example I would like the user to beable to click that cell, B10 and have the contents copied from B10 to A10. The macro would only fire any cell in column B....make sense? Thanks for your help!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy selected cells
How about double-click:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Range("B:B"), Target) Is Nothing Then Exit Sub End If If IsEmpty(Target) Then Exit Sub End If Target.Copy Target.Offset(0, -1) Cancel = True End Sub this goes in worksheet code, not a standard module -- Gary''s Student gsnu200711 " wrote: I have what I think is an easy one. I have a sheet that has about 500 rows. In Column A everything is blank. In Column B maybe blank, but there are some notes in some of the cells. What I'm trying to do is IF, there are notes in cell B10 for example I would like the user to beable to click that cell, B10 and have the contents copied from B10 to A10. The macro would only fire any cell in column B....make sense? Thanks for your help!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy selected cells
Why not do this when the user double clicks:
right click on the sheet tab and select View code. Put in code like this: Private Sub Worksheet_BeforeDoubleClick(ByVal _ Target As Range, Cancel As Boolean) If target.count = 1 then if Target.column = 2 then if not isempty(Target) then Target.offset(0,-1).value = target.value Cancel = True end if end if end if End Sub by note I assume you mean text in the cell; not a cell comment. -- Regards, Tom Ogilvy " wrote: I have what I think is an easy one. I have a sheet that has about 500 rows. In Column A everything is blank. In Column B maybe blank, but there are some notes in some of the cells. What I'm trying to do is IF, there are notes in cell B10 for example I would like the user to beable to click that cell, B10 and have the contents copied from B10 to A10. The macro would only fire any cell in column B....make sense? Thanks for your help!! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy selected cells
On Mar 23, 9:24 am, Gary''s Student
wrote: How about double-click: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Range("B:B"), Target) Is Nothing Then Exit Sub End If If IsEmpty(Target) Then Exit Sub End If Target.Copy Target.Offset(0, -1) Cancel = True End Sub this goes in worksheet code, not a standard module -- Gary''s Student gsnu200711 " wrote: I have what I think is an easy one. I have a sheet that has about 500 rows. In Column A everything is blank. In Column B maybe blank, but there are some notes in some of the cells. What I'm trying to do is IF, there are notes in cell B10 for example I would like the user to beable to click that cell, B10 and have the contents copied from B10 to A10. The macro would only fire any cell in column B....make sense? Thanks for your help!!- Hide quoted text - - Show quoted text - Perfect...thanks...I like the double click option....Thanks.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot copy selected cells | Excel Discussion (Misc queries) | |||
How can I copy the values of all selected cells to the same cells inanother Sheet | Excel Programming | |||
Copy Selected cells down a row with macro | Excel Discussion (Misc queries) | |||
Copy format from row above for selected cells | Excel Programming | |||
copy selected cells to new workbook? | Excel Programming |