Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
How can I tell if an entire column has been selected or just a few cells in the column? Thanks, Bill |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just a single column?
if selection.address = selection.cells(1).entirecolumn.address then 'whole column else 'not whole column end if Bill wrote: Hello, How can I tell if an entire column has been selected or just a few cells in the column? Thanks, Bill -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Dave,
It could be multiple columns as well. Bill "Dave Peterson" wrote in message ... Just a single column? if selection.address = selection.cells(1).entirecolumn.address then 'whole column else 'not whole column end if Bill wrote: Hello, How can I tell if an entire column has been selected or just a few cells in the column? Thanks, Bill -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if selection.address = selection.entirecolumn.address then
Bill wrote: Thanks Dave, It could be multiple columns as well. Bill "Dave Peterson" wrote in message ... Just a single column? if selection.address = selection.cells(1).entirecolumn.address then 'whole column else 'not whole column end if Bill wrote: Hello, How can I tell if an entire column has been selected or just a few cells in the column? Thanks, Bill -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bill,
How about calling this, once your cells are selected? Sub IsItAColumn() Dim CountCell As Range Dim Count As Long For Each CountCell In Selection Count = Count + 1 Next If Count = 65536 Then MsgBox ("You've selected the entire column") Else MsgBox ("You've just selected cells") End If End Sub Mind you, you might need to make it a bit more clever if you selected (for example)8 columns by 8192 rows, which equates to the same thing i.e. 65536 Hope this helps Pete "Bill" wrote: Hello, How can I tell if an entire column has been selected or just a few cells in the column? Thanks, Bill |
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 - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Identifying a selection of a selection of a range | Excel Worksheet Functions | |||
Object Type of a selection... counting rows in a selection | Excel Programming | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming |