Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with ROUND

Hi NG,
I would really appriciate some help with this code with a formula,
the calculation works, but I need the result to be rounded
e.g. 34.4 will result in 34
and 34.5 will result in 35.
Can anyone suggest how to modify this code to round the result?
TIA
Paul

Sub TotcalcCpy()
Application.ScreenUpdating = False
Sheets("IMPUT").Select
Range("J2").Select
Set frng = Sheets("IMPUT").Range("J2:J" &
Range("A65536").End(xlUp).Row)
With frng
..Formula = "=IF(F20,F2*H2/100,D2*I2)"
..Formula = .Value 'changes the formula to value
End With
Sheets("IMPUT").Select
Range("A1").Select

Application.ScreenUpdating = True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with ROUND

By the way, I forgot to mention I'm using Excel 2003 on Windows XP.

TIA
Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Help with ROUND

if you want to round both results, try this

ROUND(IF(F20,F2*H2/100,D2*I2),0)

--


Gary


"Paul" wrote in message
oups.com...
By the way, I forgot to mention I'm using Excel 2003 on Windows XP.

TIA
Paul



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Help with ROUND

Gary,
Thanks very much, that worked far simpler than I expected.
I was playing around with application.worksheetfunction.round
and was getting no where.
Thanks again.

Cheers Paul


Gary Keramidas wrote:
if you want to round both results, try this

ROUND(IF(F20,F2*H2/100,D2*I2),0)

--


Gary


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
Round Up and Round Down Time DaveMoore Excel Worksheet Functions 2 January 1st 10 12:00 PM
Round Off Fareez Excel Worksheet Functions 3 November 6th 09 10:11 AM
Round up or down cybergardener Excel Discussion (Misc queries) 7 April 11th 07 10:10 PM
round down? dbrumit Excel Discussion (Misc queries) 1 February 15th 07 04:35 PM
How do I ROUND() round off decimals of a column dataset? Højrup Excel Worksheet Functions 2 January 12th 05 10:50 AM


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