LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Rounding financial statements using vba

Hi,

I have a workbook that has an Input screen where I want the user to be
able to select the rounding option to be used for various cell values
throughout the workbook.

In this case, worksheet "Input" cell d35 has a drop-down that allows
the user to select rounding options of hundreds, thousands, or
millions. I want to place a value in worksheet "Output" cell c38 based
on a rounding of the value in cell b38. Cell b38 is formula-driven
within the Excel workbook.

I've tried to write some code to do this, but what I'm doing doesn't
work. When the macro is run, it puts a zero value in Output cell c38
no matter which rounding option I choose.

Does anyone have any suggestions as to how to rewrite this?

Sub RoundingOptions()

If Sheets("Input").Cells(35, 4).Value = "Hundred Dollars" Then
RoundingValue = -2
Else
If Sheets("Input").Cells(35, 4).Value = "Thousand Dollars" Then
RoundingValue = -3
Else
If Sheets("Input").Cells(35, 4).Value = "Million Dollars"
Then
RoundingValue = -6
Else: RoundingValue = 0
End If
End If
End If

Sheets("Output").Cells(38, 3).Value =
Application.WorksheetFunction.Round(cells(38,2)), RoundingValue)

End Sub

The subroutine above is called from a Worksheet Change event located in
the Input worksheet as follows:

Sub Worksheet_Change(ByVal Target As Excel.Range)

' Check to see which rounding option has been chosen.
Dim RoundingValue As Integer
Set CheckRange = Range("d35")

If Not Application.Intersect(Target, CheckRange) Is Nothing
Then
Call RoundingOptions
End If

End Sub


Thanks!

 
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
Excel Financial Statements Copied into Word - No Underlines when p MAB Charts and Charting in Excel 3 December 18th 07 07:46 PM
Drop TB into Financial Statements formula? Ang Excel Worksheet Functions 2 January 14th 07 10:33 PM
Dropping Trial Balance into Financial Statements Ang Excel Worksheet Functions 1 January 9th 07 01:55 AM
Can I use Exel to create Financial Statements? vinessa Reid Excel Worksheet Functions 2 December 6th 06 01:36 PM
Financial Stmt rounding issues Jeanne Excel Worksheet Functions 1 May 5th 06 06:45 PM


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