Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Event codes don't fire with change or calculate

When Sub Col_A() moves a short list of text or numbers up a row at a time, when the top entry of the list gets to A1, I need one of the event codes to fire so I can process the A1 entry.

Neither of these event codes work unless I manually enter something in A1, where the Change event works, or do a simple calculation in a cell =1+1 enter, then the Calculate event code works.

(Calc on the sheet settings is set to Automatic)

Howard


Sub Col_A()

Sheets("Sheet2").Range(Range("A1").End(xlDown), Cells(Rows.Count, "A").End(xlUp)).Cut Range("A1").End(xlDown).Offset(-1)

Sheets("Sheet2").Calculate
End Sub


Private Sub Worksheet_Calculate()

If Range("A1") < "" Then
MsgBox "A1 = " & [A1]
End If

End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target.Address < "$A$1" Then Exit Sub

MsgBox "A1 = " & [A1]

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Event codes don't fire with change or calculate

Hi Howard,

Am Tue, 21 Apr 2015 05:15:30 -0700 (PDT) schrieb L. Howard:

When Sub Col_A() moves a short list of text or numbers up a row at a time, when the top entry of the list gets to A1, I need one of the event codes to fire so I can process the A1 entry.

Neither of these event codes work unless I manually enter something in A1, where the Change event works, or do a simple calculation in a cell =1+1 enter, then the Calculate event code works.


Worksheet_Change does not work with copy & paste
Worksheet_Calculate does not work if there are no cells to calculate on
the sheet.
Write in a empty cell =TODAY() and Worksheet_Calculate works.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Event codes don't fire with change or calculate

Hi again,

Am Tue, 21 Apr 2015 05:15:30 -0700 (PDT) schrieb L. Howard:

When Sub Col_A() moves a short list of text or numbers up a row at a time, when the top entry of the list gets to A1, I need one of the event codes to fire so I can process the A1 entry.

Neither of these event codes work unless I manually enter something in A1, where the Change event works, or do a simple calculation in a cell =1+1 enter, then the Calculate event code works.


or try it without event macro:

Sub Col_A()
Dim lngStart As Long
Dim lngEnd As Long

With Sheets("Sheet2")
lngStart = .Range("A1").End(xlDown).Row
lngEnd = .Cells(Rows.Count, 1).End(xlUp).Row
.Range(.Cells(lngStart, 1), .Cells(lngEnd, 1)).Cut .Cells(lngStart -
1, 1)
End With

If lngStart - 1 = 1 Then MsgBox "A1 = " & [A1]

End Sub



Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Event codes don't fire with change or calculate


or try it without event macro:

Sub Col_A()
Dim lngStart As Long
Dim lngEnd As Long

With Sheets("Sheet2")
lngStart = .Range("A1").End(xlDown).Row
lngEnd = .Cells(Rows.Count, 1).End(xlUp).Row
.Range(.Cells(lngStart, 1), .Cells(lngEnd, 1)).Cut .Cells(lngStart -
1, 1)
End With

If lngStart - 1 = 1 Then MsgBox "A1 = " & [A1]

End Sub



Regards
Claus B.



Oh yeah. That is nice. Does a great job.

Thanks.

I've got one really goofy project going, have to take it a step at a time so will probably have some more questions.

Howard
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
Change event does not fire Lena Excel Programming 3 June 7th 10 10:16 PM
Why does change event fire when workbookclosed Rick Humphrey Excel Programming 2 April 6th 07 01:04 AM
Essbase Causing Selection Change Event to Fire Jim Thomlinson[_5_] Excel Programming 1 December 20th 05 09:39 PM
Fire Event only when Cell Change? HotRod Excel Programming 7 April 28th 05 08:43 PM
How do I get Pivot filter change event to fire? Claude Excel Programming 4 August 15th 03 10:24 PM


All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"