Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I access the source cells in Workbook_SheetChange

Hello again ..

Is there a way to access the "source" (i.e. the copied/cut cells) from
within the "Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)"
procedure along with the target cells? As I see there is no version which
also gets the source range passed.

MTIA
-arifi



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How do I access the source cells in Workbook_SheetChange

What source cells? This event is only triggered when a cell is selected, so
there is no copied/cut. If you want to copy from one cell to another, trap
the selection of the original cell and do the copy paste in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Arifi Koseoglu" wrote in message
...
Hello again ..

Is there a way to access the "source" (i.e. the copied/cut cells) from
within the "Workbook_SheetChange(ByVal Sh As Object, ByVal Target As

Range)"
procedure along with the target cells? As I see there is no version which
also gets the source range passed.

MTIA
-arifi





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I access the source cells in Workbook_SheetChange

Himm.... Worksheet_SelectionChange I assume... Thanks

"Bob Phillips" wrote in message
...
What source cells? This event is only triggered when a cell is selected,

so
there is no copied/cut. If you want to copy from one cell to another, trap
the selection of the original cell and do the copy paste in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Arifi Koseoglu" wrote in message
...
Hello again ..

Is there a way to access the "source" (i.e. the copied/cut cells) from
within the "Workbook_SheetChange(ByVal Sh As Object, ByVal Target As

Range)"
procedure along with the target cells? As I see there is no version

which
also gets the source range passed.

MTIA
-arifi







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I access the source cells in Workbook_SheetChange

there is no built in method to determine the source of the range in the
clipboard.

--
Regards,
Tom Ogilvy

"Arifi Koseoglu" wrote in message
...
Himm.... Worksheet_SelectionChange I assume... Thanks

"Bob Phillips" wrote in message
...
What source cells? This event is only triggered when a cell is selected,

so
there is no copied/cut. If you want to copy from one cell to another,

trap
the selection of the original cell and do the copy paste in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Arifi Koseoglu" wrote in message
...
Hello again ..

Is there a way to access the "source" (i.e. the copied/cut cells) from
within the "Workbook_SheetChange(ByVal Sh As Object, ByVal Target As

Range)"
procedure along with the target cells? As I see there is no version

which
also gets the source range passed.

MTIA
-arifi









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How do I access the source cells in Workbook_SheetChange

But you can save it each time, like so

Public oldCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not oldCell Is Nothing Then MsgBox oldCell.Address
Set oldCell = Target
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tom Ogilvy" wrote in message
...
there is no built in method to determine the source of the range in the
clipboard.

--
Regards,
Tom Ogilvy

"Arifi Koseoglu" wrote in message
...
Himm.... Worksheet_SelectionChange I assume... Thanks

"Bob Phillips" wrote in message
...
What source cells? This event is only triggered when a cell is

selected,
so
there is no copied/cut. If you want to copy from one cell to another,

trap
the selection of the original cell and do the copy paste in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Arifi Koseoglu" wrote in message
...
Hello again ..

Is there a way to access the "source" (i.e. the copied/cut cells)

from
within the "Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)"
procedure along with the target cells? As I see there is no version

which
also gets the source range passed.

MTIA
-arifi













  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I access the source cells in Workbook_SheetChange

I understand. Thanks folks.

Within the limits of what we have been discussing in this thread, is there
something I might have done that would disable the "Copy" in the Edit menu
but leave Ctrl-C + Ctrl-V functioning?

I have been playing with Workbook_SheetChange and
Workbook_SheetSelectionChange in as simple a way as it gets (silly source
below), and at some stage the Copy entry in the menu must have been
disabled. I am about to jump out of the window. I commented every line out -
no change.

?!?!

'Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'
' Dim UndoButtonCaption As String
' UndoButtonCaption =
Application.CommandBars(1).Controls(2).Controls(1) .Caption
'
' If UndoButtonCaption = "&Undo Paste" Then
' Dim rowCount As Integer
' Dim colCount As Integer
'
' colCount = Target.Columns.Count
' rowCount = Target.Rows.Count
'
' Call MsgBox(rowCount * colCount)
' End If
'
'End Sub

'Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
'
' Dim rowCount As Integer
' Dim colCount As Integer
'
' colCount = Target.Columns.Count
' rowCount = Target.Rows.Count
'
' Call MsgBox(rowCount * colCount)
'
'End Sub




"Bob Phillips" wrote in message
...
But you can save it each time, like so

Public oldCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not oldCell Is Nothing Then MsgBox oldCell.Address
Set oldCell = Target
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tom Ogilvy" wrote in message
...
there is no built in method to determine the source of the range in the
clipboard.

--
Regards,
Tom Ogilvy

"Arifi Koseoglu" wrote in message
...
Himm.... Worksheet_SelectionChange I assume... Thanks

"Bob Phillips" wrote in message
...
What source cells? This event is only triggered when a cell is

selected,
so
there is no copied/cut. If you want to copy from one cell to

another,
trap
the selection of the original cell and do the copy paste in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Arifi Koseoglu" wrote in message
...
Hello again ..

Is there a way to access the "source" (i.e. the copied/cut cells)

from
within the "Workbook_SheetChange(ByVal Sh As Object, ByVal Target

As
Range)"
procedure along with the target cells? As I see there is no

version
which
also gets the source range passed.

MTIA
-arifi














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
excel chart with data source from an access query rahmad Charts and Charting in Excel 7 January 31st 07 03:55 AM
I NEED TO KNOW THE SOURCE OF A PIVOTTABLE FROM ACCESS FORMULA Excel Discussion (Misc queries) 0 July 20th 06 05:27 PM
I NEED TO KNOW THE SOURCE OF A PIVOT TABLE FROM ACCESS in excel FORMULA Excel Discussion (Misc queries) 0 July 20th 06 05:26 PM
Problem with the Workbook_SheetChange event??? angel Excel Programming 0 January 29th 04 02:56 PM
Workbook_SheetChange will not fire Robert Willard Excel Programming 1 September 10th 03 07:52 PM


All times are GMT +1. The time now is 10:43 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"