Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Pls help on Macro - round formula

A small data base
A B
1 3.3456 6.3535
2 4.5656 10.3265

Want to set up a macro to round the data,Macro as below
Range("d1:e2").Select
Selection.Formula = "ROUND(RC[-3],2)

The result I got is ROUND(RC[-3],2), instead of numbers (3.35, 6.36 .etc.)


thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Pls help on Macro - round formula

You need an equals sign within the quotes as well:

Selection.Formula = "=ROUND(RC[-3],2)"

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Eastar" wrote in message
...
A small data base
A B
1 3.3456 6.3535
2 4.5656 10.3265

Want to set up a macro to round the data,Macro as below
Range("d1:e2").Select
Selection.Formula = "ROUND(RC[-3],2)

The result I got is ROUND(RC[-3],2), instead of numbers (3.35, 6.36 .etc.)


thanks




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Pls help on Macro - round formula

How about adding the equal sign and using .formulaR1C1:
Selection.FormulaR1C1 = "=ROUND(RC[-3],2)"

Or even:
Range("d1:e2").formular1c1 = "=ROUND(RC[-3],2)"
(Dropping the .select line)


Eastar wrote:

A small data base
A B
1 3.3456 6.3535
2 4.5656 10.3265

Want to set up a macro to round the data,Macro as below
Range("d1:e2").Select
Selection.Formula = "ROUND(RC[-3],2)

The result I got is ROUND(RC[-3],2), instead of numbers (3.35, 6.36 .etc.)

thanks


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Pls help on Macro - round formula

Thank you very much, guys

"Dave Peterson" wrote:

How about adding the equal sign and using .formulaR1C1:
Selection.FormulaR1C1 = "=ROUND(RC[-3],2)"

Or even:
Range("d1:e2").formular1c1 = "=ROUND(RC[-3],2)"
(Dropping the .select line)


Eastar wrote:

A small data base
A B
1 3.3456 6.3535
2 4.5656 10.3265

Want to set up a macro to round the data,Macro as below
Range("d1:e2").Select
Selection.Formula = "ROUND(RC[-3],2)

The result I got is ROUND(RC[-3],2), instead of numbers (3.35, 6.36 .etc.)

thanks


--

Dave Peterson

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 not to round a formula Janet Excel Discussion (Misc queries) 9 September 6th 07 03:28 AM
Round up Formula Help Richard Excel Discussion (Misc queries) 3 October 1st 06 08:58 PM
How do I NOT round off in a formula Sierra_07 Excel Worksheet Functions 4 October 13th 05 01:30 AM
formula to round up? John Excel Worksheet Functions 2 June 13th 05 11:29 PM
using a macro round function Ganvenk New Users to Excel 2 February 15th 05 03:29 AM


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