Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Apply a function to the entire column

Hi,
I have an Excel column full of data imported from a text
file. How do I apply an Excel function on each cell in
that column and print the result in the next column using
VBA? I don't want the user to see the function that I'm
using.

I know that I could type the function in the formula bar
and apply AutoFill across the column, but this will make
my function visible to the user.

I'm trying to avoid scanning the whole column (cell by
cell) using a FOR loop because it takes a long time.

I feel there is an easier way to do it.. please let me
know if you have an idea.

Amjad
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Apply a function to the entire column

I am new to this, so investigate my advice before you follow it. However, I
know that you can turn off screen updating while your procedure is running
and then turn it back on once it's done; I think this would solve your
problem, I'm just not sure if there are any dangers to turning off screen
updating.

"Amjad" wrote in message
...
Hi,
I have an Excel column full of data imported from a text
file. How do I apply an Excel function on each cell in
that column and print the result in the next column using
VBA? I don't want the user to see the function that I'm
using.

I know that I could type the function in the formula bar
and apply AutoFill across the column, but this will make
my function visible to the user.

I'm trying to avoid scanning the whole column (cell by
cell) using a FOR loop because it takes a long time.

I feel there is an easier way to do it.. please let me
know if you have an idea.

Amjad



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Apply a function to the entire column

Assume data is in column D and you want the results in column E

Dim rng as Range
Application.ScreenUpdating = False
set rng = Range(Cells(1,"D"),Cells(1,"D").End(xldown))
rng.offset(0,1).Formula = "=Round(" & rng(1).Address(0,0) & "/100,2)"
rng.offset(0,1).Formula = rng.offset(0,1).Value
Application.ScreenUpdating = True

the formula is just a sample of how you would enter your formula.

the last line replaces the formula with the values it produces.

--
Regards,
Tom Ogilvy


"Amjad" wrote in message
...
Hi,
I have an Excel column full of data imported from a text
file. How do I apply an Excel function on each cell in
that column and print the result in the next column using
VBA? I don't want the user to see the function that I'm
using.

I know that I could type the function in the formula bar
and apply AutoFill across the column, but this will make
my function visible to the user.

I'm trying to avoid scanning the whole column (cell by
cell) using a FOR loop because it takes a long time.

I feel there is an easier way to do it.. please let me
know if you have an idea.

Amjad



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
How to apply a function to an entire column Barb @ Work[_2_] Excel Worksheet Functions 1 May 12th 08 07:29 PM
How do I apply my function to the entire column? jsthngn Excel Discussion (Misc queries) 1 January 23rd 06 03:21 PM
I want to apply a formula to an entire column. kitcox Excel Discussion (Misc queries) 3 November 28th 05 01:48 AM
How do I apply a function to an entire column? didja New Users to Excel 1 November 23rd 05 05:04 AM
how to apply one function to an entire column of numbers guatdoc Excel Worksheet Functions 1 November 9th 05 04:26 AM


All times are GMT +1. The time now is 03:53 AM.

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"