Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() hi, could you tell what is wrong with my sub Sub lw() ActiveCell.CurrentRegion.Width End Sub thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try this
Sub lw() Dim p As Double p = ActiveCell.Columns.ColumnWidth MsgBox p End Sub -- Gary "EXCEL$B!!(BNEWS" wrote in message ... hi, could you tell what is wrong with my sub Sub lw() ActiveCell.CurrentRegion.Width End Sub thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your Sub does nothing.
It references Width property (in points) of current region. In order to have it return a value, you must turn it into a Function Function lw() as Long lw = ActiveCell.CurrentRegion.Width End Function Now you can use your Function from within a cell or another Sub/Function. HTH -- AP "EXCEL$B!!(BNEWS" a ecrit dans le message de news: ... hi, could you tell what is wrong with my sub Sub lw() ActiveCell.CurrentRegion.Width End Sub thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks a lot,
the sub is ok, you neednot change it to fun, "Ardus Petus" wrote in message ... Your Sub does nothing. It references Width property (in points) of current region. In order to have it return a value, you must turn it into a Function Function lw() as Long lw = ActiveCell.CurrentRegion.Width End Function Now you can use your Function from within a cell or another Sub/Function. HTH -- AP "EXCEL$B!!(BNEWS" a ecrit dans le message de news: ... hi, could you tell what is wrong with my sub Sub lw() ActiveCell.CurrentRegion.Width End Sub thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "EXCEL$B!!(BNEWS" wrote in message ... the sub is ok, you neednot change it to fun, It is not it is not runnable as it stands. What are you attempting to do? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lookup STRCONV in the help files.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change Cell Width WITHOUT changing Column width | Excel Discussion (Misc queries) | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
ASC() does not convert full-width to half-width letters (Exel 2003 | Excel Worksheet Functions | |||
How to make cell width different than the column width it lies in | Excel Discussion (Misc queries) |