LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old July 9th 03, 10:42 PM posted to microsoft.public.excel.programming
external usenet poster
First recorded activity by ExcelBanter: Jul 2003
Posts: 2
Default How to apply a function across a range of cells

Thanks for your code, worked fine


"Chong Moua" wrote in message
Hi Paul,

Try this....
Sub CopyFormula()

Dim i As Integer

For i = 1 To Sheets("Import").UsedRange.Rows.Count
Cells(i, "A") = Trim(Mid(Sheets("Import").Cells
(i, "A"), 28, 55)) & " " & Trim(Right(Sheets
("Import").Cells(i, "A"), 175)) & " " & (Mid(Sheets
("Import").Cells(i, "A"), 14, 12))
Next i

End Sub
Hope this helps...

Chong Moua

-----Original Message-----
Apologies for multiple postings, sent earlier but

couldn't see message
listed..just discovered system time was set to yesterday


Hi all,

I am trying to automate a tedious process that is used to

strip data from
csv files.

I have a number of files that are sent on a weekly basis,

I have a macro
that imports the file and places each line of data in a

single cell, I then
use the following formula to extract the data:

=(TRIM(MID(Import!A2,28,55))&" ")&TRIM(RIGHT(Import!


I have been copying the formula from 1:65536 as I never

know how large the
files will be, and yes some are 50,000 lines long, my

problem is that the
file is getting large and slow, what I would like to do

is have the macro
determine the start and finish point of the data and then

run the formula
against just those cells that are populated, hopefully

avoiding having to
place the formula in so many cells.

Any help appreciated



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
how to apply conditional formula over large range of cells macasst Excel Worksheet Functions 1 February 14th 11 10:50 PM
How do i apply Goal Seek to a range of cells in Excel Mabvuto Excel Worksheet Functions 1 November 21st 08 06:30 AM
How do i a apply range(autoformat) in non-adjacent cells? Brent from the Bahamas New Users to Excel 2 January 23rd 06 10:42 AM
How to apply rounding across a range of cells with other formulae Steve T Excel Worksheet Functions 1 October 20th 05 07:39 PM
How can I apply the ROUND function to a range of cells in a workbo Ellemarr Excel Discussion (Misc queries) 5 June 11th 05 01:09 AM

All times are GMT +1. The time now is 11:50 AM.

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

About Us

"It's about Microsoft Excel"


Copyright © 2017