Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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
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
Cannot copy selected cells Stevie Excel Discussion (Misc queries) 1 February 19th 10 06:06 PM
How can I copy the values of all selected cells to the same cells inanother Sheet [email protected] Excel Programming 2 August 8th 06 05:45 PM
Copy Selected cells down a row with macro DB33 Excel Discussion (Misc queries) 1 February 15th 06 05:33 PM
Copy format from row above for selected cells al007 Excel Programming 2 December 9th 05 11:49 AM
copy selected cells to new workbook? Chimanrao Excel Programming 6 October 23rd 05 06:33 PM


All times are GMT +1. The time now is 02:09 AM.

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"