Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code Interpretation

Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this statement
TRUE?
TIA,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Code Interpretation

This will happen when more than one cell is selected and the user edits the
highlighted cell. Can't think of any other circumstances.

TH

On 5/2/04 17:08, in article Jcflc.3306$nN6.50@lakeread06, "JMay"
wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code Interpretation

Thanks TH, but
I enter data in all cells A1:B4.
With A1 the activecell I highlight A1:B4
If I press F2 (on the automatically highlite Activecell - A1) and change the
data in it only
and press the enter key my MsgBox **does not** appear.
Using:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
MsgBox ("Statement is True")
End If
End Sub

What am I missing?


"TH" wrote in message
...
This will happen when more than one cell is selected and the user edits

the
highlighted cell. Can't think of any other circumstances.

TH

On 5/2/04 17:08, in article Jcflc.3306$nN6.50@lakeread06, "JMay"
wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Code Interpretation

here are a couple of ways:

Select A1:A10 and type BBB. But hit ctrl-enter instead of enter. You've filled
that range.

Copy A1:A10 to B1:B10 and you've got more than one cell.



JMay wrote:

Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this statement
TRUE?
TIA,


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code Interpretation

OK, Yes, got-em!!

"Dave Peterson" wrote in message
...
here are a couple of ways:

Select A1:A10 and type BBB. But hit ctrl-enter instead of enter. You've

filled
that range.

Copy A1:A10 to B1:B10 and you've got more than one cell.



JMay wrote:

Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this

statement
TRUE?
TIA,


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Code Interpretation

Only selecting more than one cell and then changing the active cell to
trigger the event.

--

HTH

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

"JMay" wrote in message news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this statement
TRUE?
TIA,




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code Interpretation

Bob:

If I select more than one cell in my spreadsheet,
Let's say my cursor is in cell B1 and I drag over cells
to D5 (B1:D5 now selected) I'm unable to change the active cell, Right?
Are you talking about changing the active cell via code?
TIA,
JMay

"Bob Phillips" wrote in message
...
Only selecting more than one cell and then changing the active cell to
trigger the event.

--

HTH

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

"JMay" wrote in message

news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this

statement
TRUE?
TIA,






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code Interpretation

Hitting Tab will change the active cell within the selection.

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:Esqlc.3780$nN6.2939@lakeread06...
Bob:

If I select more than one cell in my spreadsheet,
Let's say my cursor is in cell B1 and I drag over cells
to D5 (B1:D5 now selected) I'm unable to change the active cell, Right?
Are you talking about changing the active cell via code?
TIA,
JMay

"Bob Phillips" wrote in message
...
Only selecting more than one cell and then changing the active cell to
trigger the event.

--

HTH

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

"JMay" wrote in message

news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this

statement
TRUE?
TIA,








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code Interpretation

Thks Tom, yeah I'd forgotten that (tidbit)!
So now that I go back and "tab" I see my activecell change
But no MsgBox

Using:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
MsgBox ("Statement is True")
End If
End Sub

What now?

"Tom Ogilvy" wrote in message
...
Hitting Tab will change the active cell within the selection.

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:Esqlc.3780$nN6.2939@lakeread06...
Bob:

If I select more than one cell in my spreadsheet,
Let's say my cursor is in cell B1 and I drag over cells
to D5 (B1:D5 now selected) I'm unable to change the active cell, Right?
Are you talking about changing the active cell via code?
TIA,
JMay

"Bob Phillips" wrote in message
...
Only selecting more than one cell and then changing the active cell to
trigger the event.

--

HTH

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

"JMay" wrote in message

news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this

statement
TRUE?
TIA,










  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code Interpretation

I didn't suggest this action would fire an event. I just answered how to
change the activecell in a multi-cell selection.

for me, it fires neither change or selectionchange. Entering a value in the
active cell only produced a one cell target even with multiple cells
selected. Using Daves suggestion (multicell entry), it did fire a multicell
target (as expected). Deleting multiple cells did produce a multicell
target (as expected).

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:2Vqlc.3783$nN6.1057@lakeread06...
Thks Tom, yeah I'd forgotten that (tidbit)!
So now that I go back and "tab" I see my activecell change
But no MsgBox

Using:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
MsgBox ("Statement is True")
End If
End Sub

What now?

"Tom Ogilvy" wrote in message
...
Hitting Tab will change the active cell within the selection.

--
Regards,
Tom Ogilvy

"JMay" wrote in message
news:Esqlc.3780$nN6.2939@lakeread06...
Bob:

If I select more than one cell in my spreadsheet,
Let's say my cursor is in cell B1 and I drag over cells
to D5 (B1:D5 now selected) I'm unable to change the active cell,

Right?
Are you talking about changing the active cell via code?
TIA,
JMay

"Bob Phillips" wrote in message
...
Only selecting more than one cell and then changing the active cell

to
trigger the event.

--

HTH

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

"JMay" wrote in message
news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this
statement
TRUE?
TIA,














  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code Interpretation

selecting multiple cells and hitting delete to clear them would be very
common.

--
Regards,
Tom Ogilvy

"JMay" wrote in message news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this statement
TRUE?
TIA,




  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code Interpretation

Got It,
Tks,

"Tom Ogilvy" wrote in message
...
selecting multiple cells and hitting delete to clear them would be very
common.

--
Regards,
Tom Ogilvy

"JMay" wrote in message

news:Jcflc.3306$nN6.50@lakeread06...
Using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

What kind of things (list most obvious) can happen to make this

statement
TRUE?
TIA,






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
Interpretation of a piece of code FARAZ QURESHI Excel Discussion (Misc queries) 3 December 30th 07 11:29 PM
Interpretation for: =INDEX(MATCH(1 <--one [email protected] Excel Discussion (Misc queries) 3 August 24th 07 08:40 AM
Interpretation M&M[_2_] Excel Discussion (Misc queries) 2 July 14th 07 12:00 PM
Need interpretation JMay Excel Programming 2 November 12th 03 01:55 PM
value interpretation solo_razor[_28_] Excel Programming 1 November 6th 03 02:44 PM


All times are GMT +1. The time now is 11:00 PM.

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"