Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel chart with data source from an access query | Charts and Charting in Excel | |||
I NEED TO KNOW THE SOURCE OF A PIVOTTABLE FROM ACCESS | Excel Discussion (Misc queries) | |||
I NEED TO KNOW THE SOURCE OF A PIVOT TABLE FROM ACCESS in excel | Excel Discussion (Misc queries) | |||
Problem with the Workbook_SheetChange event??? | Excel Programming | |||
Workbook_SheetChange will not fire | Excel Programming |