Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Select individual cells only?

Goodmorning All,

Is it possible allowing a user to select individual cells only?
No ranges with cells.count1?

Brgds Sige

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select individual cells only?

Hi Sige

You can test the area

Sub zzzz()
Dim smallrng As Range
For Each smallrng In Selection.Areas
If smallrng.Cells.Count 1 Then MsgBox smallrng.Address & " is not a correct selection"
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Sige" wrote in message ups.com...
Goodmorning All,

Is it possible allowing a user to select individual cells only?
No ranges with cells.count1?

Brgds Sige



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Select individual cells only?

Hi Ron,
Works fine ... but as worksheet_selectchange it does what I am after.
Or quite. As I would like to have this message on every sheet in my
workbook!
But every day I start with a fresh one with about 70 sheets!

Any ideas?

MVG Sige

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Select individual cells only?

Hi Ron,

It does what it should ...but as Worksheet_SelectionChange-sub it has
the behaviour which I had in mind... or quite. As I would like to
invoke this behaviour on a fresh workbook with 70 sheets.
No other way than copying it in 1by1?

MVG Sige

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select individual cells only?

Hi Sige,

Use the Workbookbook_SheetSelectionChange event instead. This event will
operate on all sheets, existing and new.


---
Regards,
Norman



"Sige" wrote in message
oups.com...
Hi Ron,

It does what it should ...but as Worksheet_SelectionChange-sub it has
the behaviour which I had in mind... or quite. As I would like to
invoke this behaviour on a fresh workbook with 70 sheets.
No other way than copying it in 1by1?

MVG Sige





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select individual cells only?

Hi Sige,

Sorry for the stutter,

: Workbookbook_SheetSelectionChange


should be:

Workbook_SheetSelectionChange.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Sige,

Use the Workbookbook_SheetSelectionChange event instead. This event will
operate on all sheets, existing and new.


---
Regards,
Norman



"Sige" wrote in message
oups.com...
Hi Ron,

It does what it should ...but as Worksheet_SelectionChange-sub it has
the behaviour which I had in mind... or quite. As I would like to
invoke this behaviour on a fresh workbook with 70 sheets.
No other way than copying it in 1by1?

MVG Sige





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select individual cells only?

Hi Sig

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)

End Sub

In the Thisworkbook module
See
http://www.cpearson.com/excel/events.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Norman Jones" wrote in message ...
Hi Sige,

Sorry for the stutter,

: Workbookbook_SheetSelectionChange


should be:

Workbook_SheetSelectionChange.

---
Regards,
Norman



"Norman Jones" wrote in message ...
Hi Sige,

Use the Workbookbook_SheetSelectionChange event instead. This event will operate on all sheets, existing and new.


---
Regards,
Norman



"Sige" wrote in message oups.com...
Hi Ron,

It does what it should ...but as Worksheet_SelectionChange-sub it has
the behaviour which I had in mind... or quite. As I would like to
invoke this behaviour on a fresh workbook with 70 sheets.
No other way than copying it in 1by1?

MVG Sige







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Select individual cells only?

:o)

That's it! Thx

Norman Jones wrote:
Hi Sige,

Sorry for the stutter,

: Workbookbook_SheetSelectionChange


should be:

Workbook_SheetSelectionChange.

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Sige,

Use the Workbookbook_SheetSelectionChange event instead. This event will
operate on all sheets, existing and new.


---
Regards,
Norman



"Sige" wrote in message
oups.com...
Hi Ron,

It does what it should ...but as Worksheet_SelectionChange-sub it has
the behaviour which I had in mind... or quite. As I would like to
invoke this behaviour on a fresh workbook with 70 sheets.
No other way than copying it in 1by1?

MVG Sige




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Select individual cells only?

see if this is what you're looking for. right click a sheet tab, select view
code and paste it there.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count 1 Then
MsgBox Target.Address & " is not a correct selection"
End If
End Sub

--


Gary


"Sige" wrote in message
ups.com...
Goodmorning All,

Is it possible allowing a user to select individual cells only?
No ranges with cells.count1?

Brgds Sige



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Select individual cells only?

modified it a bit to not allow action on the range after the msgbox was
displayed

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count 1 Then
MsgBox Target.Address & " is not a correct selection"
ActiveCell.CurrentRegion.Cells(1, 1).Select
End If
End Sub

--


Gary


"Sige" wrote in message
ups.com...
Goodmorning All,

Is it possible allowing a user to select individual cells only?
No ranges with cells.count1?

Brgds Sige





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Select individual cells only?

Hi Gary,
Is what I am looking for!
Though ..I would like to invoke this on workbooks which I download
every day with around 70 sheets ...

Any ideas?
Sige


Gary Keramidas wrote:
modified it a bit to not allow action on the range after the msgbox was
displayed

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count 1 Then
MsgBox Target.Address & " is not a correct selection"
ActiveCell.CurrentRegion.Cells(1, 1).Select
End If
End Sub

--


Gary


"Sige" wrote in message
ups.com...
Goodmorning All,

Is it possible allowing a user to select individual cells only?
No ranges with cells.count1?

Brgds Sige


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
Blocked from Inserting individual cells or Insert Cut Cells Ching-AHS Excel Discussion (Misc queries) 0 December 1st 09 05:47 PM
Need to Select Individual Records Based on Birthdays in Current Mo PlarfySoober New Users to Excel 4 November 17th 09 06:08 AM
Up down arrow keys do not select cells if select locked cells unch roandrob Excel Discussion (Misc queries) 3 May 18th 09 12:48 AM
How do I select individual cells for a chart micachou Charts and Charting in Excel 2 July 29th 05 12:47 PM
how do you "select locked cells" w/o "select unlocked cells"? princejohnpaulfin Excel Discussion (Misc queries) 3 July 16th 05 03:53 AM


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