Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Width of ActiveCell


hi,

could you tell what is wrong with my sub

Sub lw()
ActiveCell.CurrentRegion.Width
End Sub

thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Width of ActiveCell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Width of ActiveCell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Width of ActiveCell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Width of ActiveCell


"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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Width of ActiveCell

Lookup STRCONV in the help files.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Cell Width WITHOUT changing Column width dww701 Excel Discussion (Misc queries) 1 January 12th 09 10:52 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
ASC() does not convert full-width to half-width letters (Exel 2003 DY Excel Worksheet Functions 0 January 27th 07 01:34 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM


All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"