Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the best way to capture the number of the 1st column and the number
of columns of an area selected by a user? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To get the first column of the selection, use
Dim ColNum As Integer ColNum = Selection.Cells(1,1).Column To get the number of columns selected, use Dim ColCount As Integer ColCount = Selection.Columns.Count -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ralph Heidecke" wrote in message ... What is the best way to capture the number of the 1st column and the number of columns of an area selected by a user? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just some supplemental information:
You can also simply use selection.column for the first column. and to state explicitly what Chip stated implicitly when he said Dim ColNum as Integer these methods return the column number, not the column letter - but I have never seen a case where I needed the column letter to do anything. -- Regards, Tom Ogilvy "Chip Pearson" wrote in message ... To get the first column of the selection, use Dim ColNum As Integer ColNum = Selection.Cells(1,1).Column To get the number of columns selected, use Dim ColCount As Integer ColCount = Selection.Columns.Count -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ralph Heidecke" wrote in message ... What is the best way to capture the number of the 1st column and the number of columns of an area selected by a user? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing the number of columns within existing column(s) | Excel Discussion (Misc queries) | |||
How do I turn excel columns from column number to column letter? | Setting up and Configuration of Excel | |||
Multiply two columns in Excel or one column by one number | New Users to Excel | |||
Need to indirectly reference columns 26 using A1 notation based on numeric column number- how to? | Excel Worksheet Functions | |||
Data from a number of rows and columns to one column | Excel Discussion (Misc queries) |