Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pasting a worksheet function in VBA.

Could someone please tell me how to paste a Worksheet Function into
cell in VBA.

For example this formula.

=SUM(IF(FREQUENCY(UNRng,UNRng)0,1))

Also for data running form "A2" down to the last entry in the column
need to set this range as UNRng. Please also tell me how i can achiev
this in VBA.

The data is on a Workbook called "Closures" and the worksheet i
"Sheet1".

Thanks in advance

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pasting a worksheet function in VBA.

set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
sform = " =SUM(IF(FREQUENCY(UNRng,UNRng)0,1))"
Range("C9").FormulaArray = application.Substitute(sform,"UNRng",rng.Address)

--
Regards,
Tom Ogilvy

"Jako " wrote in message
...
Could someone please tell me how to paste a Worksheet Function into a
cell in VBA.

For example this formula.

=SUM(IF(FREQUENCY(UNRng,UNRng)0,1))

Also for data running form "A2" down to the last entry in the column i
need to set this range as UNRng. Please also tell me how i can achieve
this in VBA.

The data is on a Workbook called "Closures" and the worksheet is
"Sheet1".

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/



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
Pasting formatting from one worksheet to another Jordan Excel Worksheet Functions 3 November 28th 08 09:20 PM
Paste function is greyed out in the toolbar and I can't use ctl V - worksheet won't allow pasting Bob Reynolds Excel Discussion (Misc queries) 3 December 15th 05 03:24 PM
Copying and Pasting a Worksheet Jim Pockmire Setting up and Configuration of Excel 1 September 8th 05 02:57 PM
Automatically pasting worksheet data to new worksheet with formulas COntactJason Excel Worksheet Functions 0 August 10th 05 08:22 PM
Pasting to new worksheet with formats scott[_8_] Excel Programming 1 November 8th 03 11:37 PM


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