LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default problem with UsedRange

On 30 Mrz., 14:24, Co wrote:
Hi All,

I use a code in VBA that will extract text from an excel worksheet.
I use the UsedRange option to get the row and colums with text.
Recently I had a worksheet that had 14434 rows of which maybe 20 were
with text.
The code kept cycling until it reached row 14434.
Is there a way to get only the lines with text?

hi Marco,
maybe you could use SpecialCells.

col = 1
Set CellsUsed = Columns(col).SpecialCells(xlCellTypeConstants)
For Each r In CellsUsed
'For ColNdx = StartCol To EndCol
MsgBox Cells(r.Row, col)
'next
Next

if you have text in A1, A100 and A1000,
For each r cycles from 1 to 3.

some limitations:
a cell must contain text, not a formula (see VBA help for
SpecialCells)
if there`s a text in a row, the first column must have a text

stefan
 
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
UsedRange?? problem Geoff Excel Programming 4 April 10th 08 03:48 PM
usedRange problem Hemant_india[_2_] Excel Programming 7 July 14th 06 10:02 AM
Excel VBA - UsedRange problem cata_and Excel Programming 6 June 4th 04 11:56 AM
UsedRange problem Kobayashi[_26_] Excel Programming 4 January 30th 04 05:17 PM
UsedRange problem Andy Excel Programming 2 September 18th 03 05:17 PM


All times are GMT +1. The time now is 03:23 PM.

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"