Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
Hoe do I write the code, if the selection is anything but one cell, So if I select a range all thew whole page, or a tab or a button etc. it should ignore everything, only when I select one cell then it should do .... Thanks Art |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,Art !
Hoe do I write the code, if the selection is anything but one cell So if I select a range all thew whole page, or a tab or a button etc. it should ignore everything, only when I select one cell then it should do ... i.e. Sub mySub() If TypeName(Selection) < "Range" Then Exit Sub If Selection.Count 1 Then Exit Sub MsgBox "What's next ?", , "" End Sub hth, hector. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. But when I select the whole sheet, I get the error, overflow. How can
I Correct this? "Héctor Miguel" wrote: hi,Art ! Hoe do I write the code, if the selection is anything but one cell So if I select a range all thew whole page, or a tab or a button etc. it should ignore everything, only when I select one cell then it should do ... i.e. Sub mySub() If TypeName(Selection) < "Range" Then Exit Sub If Selection.Count 1 Then Exit Sub MsgBox "What's next ?", , "" End Sub hth, hector. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi, Art !
... when I select the whole sheet, I get the error, overflow. How can I Correct this? for xl2007 change this: If Selection.Count 1 Then Exit Sub to this: If Selection.CountLarge 1 Then Exit Sub regards, hector. __ previous __ Hoe do I write the code, if the selection is anything but one cell So if I select a range all thew whole page, or a tab or a button etc. it should ignore everything, only when I select one cell then it should do ... i.e. Sub mySub() If TypeName(Selection) < "Range" Then Exit Sub If Selection.Count 1 Then Exit Sub MsgBox "What's next ?", , "" End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You must be usng Excel 2007, there are too many cells for count to handle. Why select all cells I doubt if all the cells in 2007 will ever be used, use UsedRange or CurrentRegion insteadnstead -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=99941 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Something like this Code: -------------------- If Selection.Count 1 Then MsgBox Selection.Count -------------------- -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=99941 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Macro()
If Selection.Columns.Count < 1 Or _ Selection.Rows.Count < 1 Then Exit Sub 'your code starts here '/your code end here End Sub If this post helps click Yes --------------- Jacob Skaria "art" wrote: Hello: Hoe do I write the code, if the selection is anything but one cell, So if I select a range all thew whole page, or a tab or a button etc. it should ignore everything, only when I select one cell then it should do .... Thanks Art |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Macro()
If Selection.Rows.Count < 1 Or _ Selection.Columns.Count < 1 Then Exit Sub 'your code starts here '/end End Sub If this post helps click Yes --------------- Jacob Skaria "art" wrote: Hello: Hoe do I write the code, if the selection is anything but one cell, So if I select a range all thew whole page, or a tab or a button etc. it should ignore everything, only when I select one cell then it should do .... Thanks Art |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Copy Selection - Paste Selection - Delete Selection | Excel Programming | |||
How to create a selection list then display the selection in a cell | Excel Programming | |||
Change from Column Selection to Cell Selection | Excel Programming | |||
limit cell list selection based on the selection of another list | Excel Worksheet Functions |