PC Review


Reply
Thread Tools Rate Thread

Copy selected cells

 
 
jeff.white@amcore.com
Guest
Posts: n/a
 
      23rd Mar 2007
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!!

 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      23rd Mar 2007
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


"(E-Mail Removed)" 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!!
>
>

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      23rd Mar 2007
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

"(E-Mail Removed)" 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!!
>
>

 
Reply With Quote
 
jeff.white@amcore.com
Guest
Posts: n/a
 
      23rd Mar 2007
On Mar 23, 9:24 am, Gary''s Student
<GarysStud...@discussions.microsoft.com> 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
>
>
>
> "jeff.wh...@amcore.com" 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot copy selected cells Stevie Microsoft Excel Misc 1 19th Feb 2010 06:06 PM
Insert row and copy cells from the currently selected row =?Utf-8?B?RGFsZSBGeWU=?= Microsoft Excel Programming 4 29th Jan 2008 09:32 PM
How can I copy the values of all selected cells to the same cells inanother Sheet hans.domian@de.man-mn.com Microsoft Excel Programming 2 8th Aug 2006 05:45 PM
auto copy only selected cells Keith Crooks Microsoft Excel Worksheet Functions 1 25th Feb 2006 09:42 PM
Copy format from row above for selected cells al007 Microsoft Excel Programming 2 9th Dec 2005 11:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:49 PM.