Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default New Collection add trim

This works perfect but how would I add the following? Please Help.
How can I add if len(trim(cell)) <9521 then

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default New Collection add trim

Hi,
You can just do
if len(trim(cell)) 0 AND len(trim(cell)) <9521 Then

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

This works perfect but how would I add the following? Please Help.
How can I add if len(trim(cell)) <9521 then

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default New Collection add trim

Thanks,

"sebastienm" wrote:

Hi,
You can just do
if len(trim(cell)) 0 AND len(trim(cell)) <9521 Then

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

This works perfect but how would I add the following? Please Help.
How can I add if len(trim(cell)) <9521 then

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default New Collection add trim

For some reason that didn't work I still get 9585.xls cannot be found

"Tomkat743" wrote:

Thanks,

"sebastienm" wrote:

Hi,
You can just do
if len(trim(cell)) 0 AND len(trim(cell)) <9521 Then

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

This works perfect but how would I add the following? Please Help.
How can I add if len(trim(cell)) <9521 then

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default New Collection add trim

ok i guess you are not loooking for the length of the cell text to be less
than 9521 but for its value to be less than 9521:

if len(trim(cell)) 0 AND val(trim(cell)) <9521 AND val(trim(cell)) 0
Then

- the first part of the condition makes sure there is some non-blank text in
the cell: LEngth 0
- the two following conditions make sur the Value is greater than 0 and less
than 9521.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

For some reason that didn't work I still get 9585.xls cannot be found

"Tomkat743" wrote:

Thanks,

"sebastienm" wrote:

Hi,
You can just do
if len(trim(cell)) 0 AND len(trim(cell)) <9521 Then

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

This works perfect but how would I add the following? Please Help.
How can I add if len(trim(cell)) <9521 then

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default New Collection add trim

Thanks that fixed it.

"sebastienm" wrote:

ok i guess you are not loooking for the length of the cell text to be less
than 9521 but for its value to be less than 9521:

if len(trim(cell)) 0 AND val(trim(cell)) <9521 AND val(trim(cell)) 0
Then

- the first part of the condition makes sure there is some non-blank text in
the cell: LEngth 0
- the two following conditions make sur the Value is greater than 0 and less
than 9521.

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

For some reason that didn't work I still get 9585.xls cannot be found

"Tomkat743" wrote:

Thanks,

"sebastienm" wrote:

Hi,
You can just do
if len(trim(cell)) 0 AND len(trim(cell)) <9521 Then

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Tomkat743" wrote:

This works perfect but how would I add the following? Please Help.
How can I add if len(trim(cell)) <9521 then

Dim bkList As New Collection
With Workbooks("1DLSUNDAY.XLS").Worksheets("Master")
Set rng = .Range(.Cells(2, 3), .Cells(200, 3).End(xlDown))
End With

On Error Resume Next
For Each cell In rng
if len(trim(cell)) 0 then
bkList.Add Trim(cell.Text), Trim(cell.Text)
end if
Next
On Error GoTo 0

For Each itm In bkList
Workbooks.Open "C:\Documents and Settings\Tom\Desktop\CHARTER BLANK\NEW
BLANK\" & _
itm & ".xls"
Next

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
=TRIM Shayra Excel Discussion (Misc queries) 5 October 16th 08 07:16 PM
trim geza Excel Worksheet Functions 2 June 8th 05 07:03 PM
VBA and Trim Jake[_10_] Excel Programming 1 January 25th 05 07:01 PM
VBA Trim and Application.worksheetfunction.Trim Hari Prasadh Excel Programming 3 January 19th 05 02:22 PM
Trim like worksheet Trim Bob Phillips[_5_] Excel Programming 0 August 20th 03 07:10 PM


All times are GMT +1. The time now is 03:02 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"