Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Functions in Excel macro


Hello,

I am trying to write an Excel macro. I want to use the following
functions that are available in Excel. Please let me know what are the
corresponding VB functions/syntax for the macro:
Excel Functions:
MOD(n,k)
Floor(n,k)
Ceiling(n,k)

Thanks

Srikanth


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Functions in Excel macro

Hi Srikanth

You can use the Floor and Ceiling worksheet functions in VBA thus:

Res = Application.WorksheetFunction.Floor(n, k)
Res = Application.WorksheetFunction.Ceiling(n, k)

VBA has its own Mod operator, the syntax being:

Res = n Mod k

---
Regards,
Norman



"Srikanth Ganesan" wrote in message
...

Hello,

I am trying to write an Excel macro. I want to use the following
functions that are available in Excel. Please let me know what are the
corresponding VB functions/syntax for the macro:
Excel Functions:
MOD(n,k)
Floor(n,k)
Ceiling(n,k)

Thanks

Srikanth


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Functions in Excel macro

Srikanth,

x = n Mod k
x = WorksheetFunction.Floor(n, k)
x = WorksheetFunction.Ceiling(n, k)

Regards,
Jim Cone
San Francisco, CA

Srikanth Ganesan" wrote in message ...
Hello,
I am trying to write an Excel macro. I want to use the following
functions that are available in Excel. Please let me know what are the
corresponding VB functions/syntax for the macro:
Excel Functions:
MOD(n,k)
Floor(n,k)
Ceiling(n,k)
Thanks
Srikanth


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
String functions in VB macro Aerojade Excel Discussion (Misc queries) 6 October 3rd 08 02:36 PM
macro and/or functions Sue Excel Worksheet Functions 4 February 24th 08 12:49 PM
excel functions and User defined functions Kanan Excel Programming 4 May 20th 04 11:21 PM
Convert Excel Functions to VBA Macro Function Simon Corner Excel Programming 3 April 2nd 04 11:58 AM
Can Excel macro have functions to check POP3 email! bookworm98[_14_] Excel Programming 0 January 29th 04 10:49 AM


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