Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
sacredarms
 
Posts: n/a
Default Increase all cells by a % and round up?

I have a spreadsheet that I need to increase all cells by a fixed percentage
and round up. I know I can use the paste special for the increase but is
there a way I can do both at the same time? Any help appreciated.

Thanks
Joe
  #2   Report Post  
Posted to microsoft.public.excel.misc
tjtjjtjt
 
Posts: n/a
Default Increase all cells by a % and round up?

This macro works for me. I have it set to round to the nearest integer.
Change the 1 in the line "Then x.Value =
Application.WorksheetFunction.Ceiling (x.Value + x.Value * s, 1)" to whatever
number you want to round up to. Check out Excel's help on CEILING and/or
ROUNDUP for more info.

Hope this helps.
Post back if you need more information about using macros.

Sub IncreaseAndRoundUp()
Dim x As Range
Dim s As Variant

s = InputBox("Please type a percentage value as" & _
"a decimal." & vbCr & "e.g.: 0.10")

If Left(s, 1) = "." Or Mid(s, 2, 1) = "." Then

For Each x In ActiveSheet.UsedRange.Cells

If Application.WorksheetFunction.IsNumber(x.Value) _
Then x.Value = Application.WorksheetFunction.Ceiling _
(x.Value + x.Value * s, 1)
Next x

Else

MsgBox ("Please type a percentage value as" & _
"a decimal." & vbCr & "e.g.: 0.10")
End If

End Sub

--
tj


"sacredarms" wrote:

I have a spreadsheet that I need to increase all cells by a fixed percentage
and round up. I know I can use the paste special for the increase but is
there a way I can do both at the same time? Any help appreciated.

Thanks
Joe

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 whole numbers up and down JoeBed Excel Discussion (Misc queries) 4 July 5th 05 05:21 PM
How can I apply the ROUND function to a range of cells in a workbo Ellemarr Excel Discussion (Misc queries) 5 June 11th 05 01:09 AM
increase cell 255 limit in excel2000 help or way round it? lisa Excel Discussion (Misc queries) 3 May 20th 05 12:39 AM
round up cells to $xx.99 RVV Excel Worksheet Functions 2 March 31st 05 08:31 PM
How do I format cells to round to the nearest thousands without .. excel user Excel Discussion (Misc queries) 1 March 16th 05 08:10 PM


All times are GMT +1. The time now is 07:16 AM.

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"