View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Sean Timmons Sean Timmons is offline
external usenet poster
 
Posts: 1,696
Default Macro for copy and paste values

Range("D10").NumberFormat = "0.00"

"excelnerd" wrote:

Hi,

I am running the following macro for copying a number derived from a goal
seek function and pasting into another worksheet.


Dim A As String

A = Sheets("Sheets1").Range("A10").Value
Sheets("Sheets1").Range("A15").GoalSeek Goal:=A,
ChangingCell:=Sheets("Sheets2").Range("D10")

The macro works fine and my sheets2.D10 gets a value with 15 decimal places.
However, I want it to roundup to 2 decimal places by adding the roundup
function in the above macro. How can I do this?

A quick help would be greatly appreciated. Many thanks.

 
ExcelBanter Database Error
Database Error Database error
The ExcelBanter database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.excelbanter.com home page, then try to open another page.
  • Click the Back button to try another link.
The www.excelbanter.com forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.