Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What has the User selected?
Hello ever helpful people, If a user selects a range in a sheet, is it possible to determine if he has selected a range of cells or an entire row or column? I have tried naieve things like for each mycell in selection if mycell.selection.entrierow = true then ... but no luck. Any help please? many thanks, Bony |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What has the User selected?
If Selection.cells.count = columns.count And selection.rows.count=1 Then '1 full Row selected If selection.rows.count = rows.count And selection.columns.count=1 then '1 full Column selected In 2007 you need to use .CountLarge If this post helps click Yes --------------- Jacob Skaria "Bony Pony" wrote: Hello ever helpful people, If a user selects a range in a sheet, is it possible to determine if he has selected a range of cells or an entire row or column? I have tried naieve things like for each mycell in selection if mycell.selection.entrierow = true then ... but no luck. Any help please? many thanks, Bony |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What has the User selected?
The code is correct. When myrange.Rows.Count = Rows.Count indicates the entire column is selected. Same applies for entire row. Set myrange = Selection MsgBox (myrange.Address) MsgBox (myrange.Rows.Count) MsgBox (myrange.Columns.Count) If myrange.Rows.Count = Rows.Count Then MsgBox ("entire column is selected") End If If myrange.Columns.Count = Columns.Count Then MsgBox ("entire row is selected") End If "Bony Pony" wrote: Hello ever helpful people, If a user selects a range in a sheet, is it possible to determine if he has selected a range of cells or an entire row or column? I have tried naieve things like for each mycell in selection if mycell.selection.entrierow = true then ... but no luck. Any help please? many thanks, Bony |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
What has the User selected?
Hi Joel / Jacob, Many thanks! As always, the answer within Excel is to think laterally and keep it simple, Kind regards, Bony "Bony Pony" wrote: Hello ever helpful people, If a user selects a range in a sheet, is it possible to determine if he has selected a range of cells or an entire row or column? I have tried naieve things like for each mycell in selection if mycell.selection.entrierow = true then ... but no luck. Any help please? many thanks, Bony |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
What has the User selected?
Hi Jacob, Thanks for the countlarge tip ... Kind regards, Bony "Jacob Skaria" wrote: If Selection.cells.count = columns.count And selection.rows.count=1 Then '1 full Row selected If selection.rows.count = rows.count And selection.columns.count=1 then '1 full Column selected In 2007 you need to use .CountLarge If this post helps click Yes --------------- Jacob Skaria "Bony Pony" wrote: Hello ever helpful people, If a user selects a range in a sheet, is it possible to determine if he has selected a range of cells or an entire row or column? I have tried naieve things like for each mycell in selection if mycell.selection.entrierow = true then ... but no luck. Any help please? many thanks, Bony |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User Selected Month | Excel Programming | |||
How to: User selected range? | Excel Programming | |||
How to sort on the row selected by user? | Excel Programming | |||
Checking to see if user selected an Option | Excel Programming | |||
How to find out what the user selected? | Excel Programming |