Thread: column count
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
guest guest is offline
external usenet poster
 
Posts: 20
Default column count

Thanks Jim and Rick for your help.

"Rick Rothstein (MVP - VB)" wrote:

Not reliably. Try this... put some data in some of the rows out to Column 5
on a sheet and then put something in J3. Go to the Immediate window and
enter this...

? ActiveCell.SpecialCells(xlLastCell).Column

It should print out 10. Now issue this command in the Immediate window

Range("J3").Delete

That will remove the entry from J3 that you just put in it. Look at the
worksheet... the last used column is now 5. Go back and execute this line
again...

? ActiveCell.SpecialCells(xlLastCell).Column

It should still print out 10.

Rick



"Reitanos" wrote in message
...
Can't you just use
ActiveCell.SpecialCells(xlLastCell).Select


On Jun 13, 2:43 pm, guest wrote:
is there a way to find last column that has data in a given worksheet??
without selecting the range of data.