Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Enz Enz is offline
external usenet poster
 
Posts: 21
Default using string functions within a range?

I think I know the answer to this question, but I am looking for a
suggestion to try...

Background
I have an inefficient piece of code that is determining whether to
process a record before copying it into the macro file. I was doing
this line by line originally but it is turning out that it has to
process approx. 30,000 rows (takes 10 minutes to run). So I am in the
process of converting this part of the macro to use auto filter.

Question - Can I apply string functions to a range? I think the
answer to this is no.

The original logic i used to copy the one line was:
wsTempTab.Cells(lcurrentTempRecord, 20).Value = Trim
(WWExtractInput.Worksheets(1).Cells(x, 8).Value) &
WWExtractInput.Sheets(1).Cells(x, 20).Value

I can create 2 range objects (each about 30,000 rows of one column
each) and use the union on the ranges to combine them and paste into
one column, but I need to do a trim to the content of the rows within
the ranges first.

Does anyone have a suggestion to do this efficiently?

Thanks in advance,
Enzo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default using string functions within a range?

You can do something liket his with your range objects

myRange.formulaR1C1 = "=TRIM(RC8 & RC20)"

(untested)
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Enz" wrote:

I think I know the answer to this question, but I am looking for a
suggestion to try...

Background
I have an inefficient piece of code that is determining whether to
process a record before copying it into the macro file. I was doing
this line by line originally but it is turning out that it has to
process approx. 30,000 rows (takes 10 minutes to run). So I am in the
process of converting this part of the macro to use auto filter.

Question - Can I apply string functions to a range? I think the
answer to this is no.

The original logic i used to copy the one line was:
wsTempTab.Cells(lcurrentTempRecord, 20).Value = Trim
(WWExtractInput.Worksheets(1).Cells(x, 8).Value) &
WWExtractInput.Sheets(1).Cells(x, 20).Value

I can create 2 range objects (each about 30,000 rows of one column
each) and use the union on the ranges to combine them and paste into
one column, but I need to do a trim to the content of the rows within
the ranges first.

Does anyone have a suggestion to do this efficiently?

Thanks in advance,
Enzo

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
help with string functions please KRK New Users to Excel 4 June 29th 09 12:36 PM
String Functions John Excel Programming 2 July 9th 08 03:51 PM
STRING functions anar_baku Excel Worksheet Functions 4 November 8th 05 05:05 PM
Passing a String in Array to Range as String [email protected] Excel Programming 2 September 1st 04 01:13 AM
help with string functions margie[_6_] Excel Programming 2 February 25th 04 02:34 PM


All times are GMT +1. The time now is 06:30 PM.

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

About Us

"It's about Microsoft Excel"